** Do file, generating variables for "Serious Conflicts with Benign Outcomes? The Electoral Consequences of Conflictual Cabinet Terminations" **

** File used: Dataset-WECEE-Dec-2021-with-party-strings.dta **

use "[FILE PATH]\Dataset-WECEE-Dec-2021-with-party-strings.dta"


********************************* GENERATING VARIABLES' VALUES ************************************************************


***** EXPANDING THE DATASET INTO PARTY-CABINET OBSERVATIONS *****

expand cab_num_parties
bysort cab_id : gen cab_party=_n

***** ADDING NEW VARIABLES ON PER CAPITA GDP GROWTH RATE, NEXT PROXIMATE ELECTION DATES, AND PARTIES' L-R POSITIONS IN ORIGINAL DATASET *****
  
gen countryname=""
replace countryname="Austria" if country_id==1
replace countryname="Belgium" if country_id==2
replace countryname="Denmark" if country_id==3
replace countryname="Finland" if country_id==4
replace countryname="France" if country_id==5
replace countryname="Germany" if country_id==6
replace countryname="Greece" if country_id==7
replace countryname="Iceland" if country_id==8
replace countryname="Ireland" if country_id==9
replace countryname="Italy" if country_id==10
replace countryname="the Netherlands" if country_id==12
replace countryname="Norway" if country_id==13
replace countryname="Portugal" if country_id==14
replace countryname="Spain" if country_id==15
replace countryname="Sweden" if country_id==16
replace countryname="United Kingdom" if country_id==17
replace countryname="Bulgaria" if country_id==18
replace countryname="Czech Republic" if country_id==20
replace countryname="Estonia" if country_id==21
replace countryname="Hungary" if country_id==22
replace countryname="Latvia" if country_id==23
replace countryname="Lithuania" if country_id==24
replace countryname="Poland" if country_id==26
replace countryname="Romania" if country_id==27
replace countryname="Slovakia" if country_id==28
replace countryname="Slovenia" if country_id==29
replace countryname="Croatia" if country_id==30

gen partyname=""
replace partyname=cab_party1 if cab_party==1
replace partyname=cab_party2 if cab_party==2
replace partyname=cab_party3 if cab_party==3
replace partyname=cab_party4 if cab_party==4
replace partyname=cab_party5 if cab_party==5
replace partyname=cab_party6 if cab_party==6
replace partyname=cab_party7 if cab_party==7
replace partyname=cab_party8 if cab_party==8
 
gen next_election=.
format %tdnn/dd/CCYY next_election
  
replace next_election=-3736 if elecdate==-5150 & country_id==1
replace next_election=-2504 if elecdate==-3736 & country_id==1
replace next_election=-1328 if elecdate==-2504 & country_id==1
replace next_election=-236 if elecdate==-1328 & country_id==1
replace next_election=1052 if elecdate==-236 & country_id==1
replace next_election=2256 if elecdate==1052 & country_id==1
replace next_election=3712 if elecdate==2256 & country_id==1
replace next_election=4300 if elecdate==3712 & country_id==1
replace next_election=5756 if elecdate==4300 & country_id==1
replace next_election=7065 if elecdate==5756 & country_id==1
replace next_election=8514 if elecdate==7065 & country_id==1
replace next_election=9823 if elecdate==8514 & country_id==1
replace next_election=11237 if elecdate==9823 & country_id==1
replace next_election=12700 if elecdate==11237 & country_id==1
replace next_election=13134 if elecdate==12700 & country_id==1
replace next_election=14520 if elecdate==13134 & country_id==1
replace next_election=15668 if elecdate==14520 & country_id==1
replace next_election=17075 if elecdate==15668 & country_id==1
replace next_election=17803 if elecdate==17075 & country_id==1
replace next_election=19630 if elecdate==17803 & country_id==1
replace next_election=21107 if elecdate==19630 & country_id==1
replace next_election=21107+714 if elecdate==21107 & country_id==1

replace next_election=-3841 if elecdate==-5066 & country_id==2
replace next_election=-3498 if elecdate==-3841 & country_id==2
replace next_election=-2091 if elecdate==-3498 & country_id==2
replace next_election=-579 if elecdate==-2091 & country_id==2
replace next_election=450 if elecdate==-579 & country_id==2
replace next_election=1969 if elecdate==450 & country_id==2
replace next_election=3012 if elecdate==1969 & country_id==2
replace next_election=4328 if elecdate==3012 & country_id==2
replace next_election=5182 if elecdate==4328 & country_id==2
replace next_election=6316 if elecdate==5182 & country_id==2
replace next_election=6925 if elecdate==6316 & country_id==2
replace next_election=7982 if elecdate==6925 & country_id==2
replace next_election=9417 if elecdate==7982 & country_id==2
replace next_election=10208 if elecdate==9417 & country_id==2
replace next_election=11650 if elecdate==10208 & country_id==2
replace next_election=12924 if elecdate==11650 & country_id==2
replace next_election=14408 if elecdate==12924 & country_id==2
replace next_election=15843 if elecdate==14408 & country_id==2
replace next_election=17327 if elecdate==15843 & country_id==2
replace next_election=18426 if elecdate==17327 & country_id==2
replace next_election=19868 if elecdate==18426 & country_id==2
replace next_election=19868+1827 if elecdate==19868 & country_id==2

replace next_election=-4448 if elecdate==-5176 & country_id==3
replace next_election=-3405 if elecdate==-4448 & country_id==3
replace next_election=-2446 if elecdate==-3405 & country_id==3
replace next_election=-2292 if elecdate==-2446 & country_id==3
replace next_election=-962 if elecdate==-2292 & country_id==3
replace next_election=319 if elecdate==-962 & country_id==3
replace next_election=1726 if elecdate==319 & country_id==3
replace next_election=2517 if elecdate==1726 & country_id==3
replace next_election=2944 if elecdate==2517 & country_id==3
replace next_election=4281 if elecdate==2944 & country_id==3
replace next_election=5086 if elecdate==4281 & country_id==3
replace next_election=5487 if elecdate==5086 & country_id==3
replace next_election=6255 if elecdate==5487 & country_id==3
replace next_election=7235 if elecdate==6255 & country_id==3 
replace next_election=8012 if elecdate==7235 & country_id==3
replace next_election=8775 if elecdate==8012 & country_id==3
replace next_election=10112 if elecdate==8775 & country_id==3
replace next_election=10357 if elecdate==10112 & country_id==3
replace next_election=11303 if elecdate==10357 & country_id==3 
replace next_election=12682 if elecdate==11303 & country_id==3
replace next_election=13949 if elecdate==12682 & country_id==3
replace next_election=15299 if elecdate==13949 & country_id==3
replace next_election=16475 if elecdate==15299 & country_id==3
replace next_election=17483 if elecdate==16475 & country_id==3
replace next_election=18885 if elecdate==17483 & country_id==3
replace next_election=20257 if elecdate==18885 & country_id==3
replace next_election=20257+1448 if elecdate==20257 & country_id==3

replace next_election=-4200 if elecdate==-5402 & country_id==4
replace next_election=-3104 if elecdate==-4200 & country_id==4
replace next_election=-2125 if elecdate==-3104 & country_id==4
replace next_election=-543 if elecdate==-2125 & country_id==4 
replace next_election=766 if elecdate==-543 & country_id==4
replace next_election=2271 if elecdate==766 & country_id==4
replace next_election=3727 if elecdate==2271 & country_id==4
replace next_election=4385 if elecdate==3727 & country_id==4
replace next_election=5743 if elecdate==4385 & country_id==4
replace next_election=7017 if elecdate==5743 & country_id==4
replace next_election=8480 if elecdate==7017 & country_id==4
replace next_election=9936 if elecdate==8480 & country_id==4
replace next_election=11398 if elecdate==9936 & country_id==4
replace next_election=12861 if elecdate==11398 & country_id==4
replace next_election=14324 if elecdate==12861 & country_id==4
replace next_election=15780 if elecdate==14324 & country_id==4
replace next_election=17243 if elecdate==15780 & country_id==4
replace next_election=18734 if elecdate==17243 & country_id==4
replace next_election=20197 if elecdate==18734 & country_id==4
replace next_election=20197+1456 if elecdate==20197 & country_id==4

replace next_election=1059 if elecdate==-397 & country_id==5
replace next_election=2627 if elecdate==1059 & country_id==5
replace next_election=3103 if elecdate==2627 & country_id==5
replace next_election=4818 if elecdate==3103 & country_id==5
replace next_election=6652 if elecdate==4818 & country_id==5
replace next_election=7842 if elecdate==6652 & country_id==5
replace next_election=9571 if elecdate==7842 & country_id==5
replace next_election=10390 if elecdate==9571 & country_id==5
replace next_election=12140 if elecdate==10390 & country_id==5
replace next_election=13666 if elecdate==12140 & country_id==5
replace next_election=15507 if elecdate==13666 & country_id==5
replace next_election=17334 if elecdate==15507 & country_id==5
replace next_election=19161 if elecdate==17334 & country_id==5
replace next_election=20988 if elecdate==19161 & country_id==5

 
replace next_election=-2308 if elecdate==-3792 & country_id==6
replace next_election=-838 if elecdate==-2308 & country_id==6 
replace next_election=625 if elecdate==-838 & country_id==6
replace next_election=2088 if elecdate==625 & country_id==6
replace next_election=3558 if elecdate==2088 & country_id==6
replace next_election=4706 if elecdate==3558 & country_id==6
replace next_election=6120 if elecdate==4706 & country_id==6
replace next_election=7583 if elecdate==6120 & country_id==6
replace next_election=8465 if elecdate==7583 & country_id==6
replace next_election=9886 if elecdate==8465 & country_id==6
replace next_election=11293 if elecdate==9886 & country_id==6
replace next_election=12707 if elecdate==11293 & country_id==6
replace next_election=14149 if elecdate==12707 & country_id==6
replace next_election=15605 if elecdate==14149 & country_id==6
replace next_election=16697 if elecdate==15605 & country_id==6
replace next_election=18167 if elecdate==16697 & country_id==6
replace next_election=19623 if elecdate==18167 & country_id==6
replace next_election=21086 if elecdate==19623 & country_id==6
replace next_election=21086+1463 if elecdate==21086 & country_id==6

replace next_election=7961 if elecdate==6533 & country_id==7
replace next_election=9284 if elecdate==7961 & country_id==7
replace next_election=10761 if elecdate==9284 & country_id==7
replace next_election=10901 if elecdate==10761 & country_id==7
replace next_election=11055 if elecdate==10901 & country_id==7
replace next_election=12336 if elecdate==11055 & country_id==7
replace next_election=13414 if elecdate==12336 & country_id==7
replace next_election=14709 if elecdate==13414 & country_id==7
replace next_election=16137 if elecdate==14709 & country_id==7         
replace next_election=17425 if elecdate==16137 & country_id==7
replace next_election=18174 if elecdate==17425 & country_id==7
replace next_election=19119 if elecdate==18174 & country_id==7
replace next_election=19161 if elecdate==19119 & country_id==7
replace next_election=20113 if elecdate==19161 & country_id==7
replace next_election=20351 if elecdate==20113 & country_id==7
replace next_election=20351+1386 if elecdate==20351 & country_id==7
 
replace next_election=-4933 if elecdate==-5552 & country_id==8
replace next_election=-3721 if elecdate==-4933 & country_id==8
replace next_election=-2378 if elecdate==-3721 & country_id==8
replace next_election=-1286 if elecdate==-2378 & country_id==8
replace next_election=-187 if elecdate==-1286 & country_id==8
replace next_election=-67 if elecdate==-187 & country_id==8
replace next_election=1255 if elecdate==-67 & country_id==8
replace next_election=2718 if elecdate==1255 & country_id==8
replace next_election=4181 if elecdate==2718 & country_id==8
replace next_election=5294 if elecdate==4181 & country_id==8
replace next_election=6750 if elecdate==5294 & country_id==8
replace next_election=7276 if elecdate==6750 & country_id==8
replace next_election=8513 if elecdate==7276 & country_id==8
replace next_election=9976 if elecdate==8513 & country_id==8
replace next_election=11432 if elecdate==9976 & country_id==8
replace next_election=12881 if elecdate==11432 & country_id==8
replace next_election=14372 if elecdate==12881 & country_id==8
replace next_election=15835 if elecdate==14372 & country_id==8
replace next_election=17298 if elecdate==15835 & country_id==8
replace next_election=18012 if elecdate==17298 & country_id==8
replace next_election=19475 if elecdate==18012 & country_id==8
replace next_election=20756 if elecdate==19475 & country_id==8
replace next_election=21120 if elecdate==20756 & country_id==8
replace next_election=21120+1428 if elecdate==21120 & country_id==8
 
replace next_election=-4349 if elecdate==-5694 & country_id==9
replace next_election=-3138 if elecdate==-4349 & country_id==9
replace next_election=-2054 if elecdate==-3138 & country_id==9
replace next_election=-1032 if elecdate==-2054 & country_id==9
replace next_election=642 if elecdate==-1032 & country_id==9
replace next_election=1923 if elecdate==642 & country_id==9
replace next_election=3456 if elecdate==1923 & country_id==9
replace next_election=4807 if elecdate==3456 & country_id==9
replace next_election=6376 if elecdate==4807 & country_id==9
replace next_election=7832 if elecdate==6376 & country_id==9
replace next_election=8084 if elecdate==7832 & country_id==9
replace next_election=8363 if elecdate==8084 & country_id==9
replace next_election=9909 if elecdate==8363 & country_id==9
replace next_election=10758 if elecdate==9909 & country_id==9
replace next_election=12017 if elecdate==10758 & country_id==9
replace next_election=13671 if elecdate==12017 & country_id==9
replace next_election=15477 if elecdate==13671 & country_id==9
replace next_election=17310 if elecdate==15477 & country_id==9
replace next_election=18683 if elecdate==17310 & country_id==9
replace next_election=20510 if elecdate==18683 & country_id==9
replace next_election=20510+1443 if elecdate==20510 & country_id==9

replace next_election=-4275 if elecdate==-4961 & country_id==10
replace next_election=-2399 if elecdate==-4275 & country_id==10
replace next_election=-586 if elecdate==-2399 & country_id==10
replace next_election=1213 if elecdate==-586 & country_id==10
replace next_election=3061 if elecdate==1213 & country_id==10
replace next_election=4510 if elecdate==3061 & country_id==10
replace next_election=6016 if elecdate==4510 & country_id==10
replace next_election=7093 if elecdate==6016 & country_id==10
replace next_election=8577 if elecdate==7093 & country_id==10
replace next_election=10026 if elecdate==8577 & country_id==10
replace next_election=11784 if elecdate==10026 & country_id==10
replace next_election=12505 if elecdate==11784 & country_id==10
replace next_election=13260 if elecdate==12505 & country_id==10
replace next_election=15108 if elecdate==13260 & country_id==10
replace next_election=16901 if elecdate==15108 & country_id==10
replace next_election=17636 if elecdate==16901 & country_id==10
replace next_election=19414 if elecdate==17636 & country_id==10
replace next_election=21247 if elecdate==19414 & country_id==10

replace next_election=-4195 if elecdate==-4977 & country_id==12
replace next_election=-2746 if elecdate==-4195 & country_id==12
replace next_election=-1297 if elecdate==-2746 & country_id==12  
replace next_election=-295 if elecdate==-1297 & country_id==12
replace next_election=1230 if elecdate==-295 & country_id==12
replace next_election=2602 if elecdate==1230 & country_id==12
replace next_election=4135 if elecdate==2602 & country_id==12
replace next_election=4716 if elecdate==4135 & country_id==12
replace next_election=6354 if elecdate==4716 & country_id==12
replace next_election=7816 if elecdate==6354 & country_id==12
replace next_election=8286 if elecdate==7816 & country_id==12
replace next_election=9637 if elecdate==8286 & country_id==12
replace next_election=10841 if elecdate==9637 & country_id==12
replace next_election=12541 if elecdate==10841 & country_id==12
replace next_election=14005 if elecdate==12541 & country_id==12
replace next_election=15475 if elecdate==14005 & country_id==12
replace next_election=15727 if elecdate==15475 & country_id==12
replace next_election=17127 if elecdate==15727 & country_id==12
replace next_election=18422 if elecdate==17127 & country_id==12
replace next_election=19248 if elecdate==18422 & country_id==12
replace next_election=20893 if elecdate==19248 & country_id==12
replace next_election=20893+1461 if elecdate==20893 & country_id==12

replace next_election=-3735 if elecdate==-5198 & country_id==13
replace next_election=-2272 if elecdate==-3735 & country_id==13
replace next_election=-816 if elecdate==-2272 & country_id==13
replace next_election=619 if elecdate==-816 & country_id==13
replace next_election=2082 if elecdate==619 & country_id==13
replace next_election=3538 if elecdate==2082 & country_id==13
replace next_election=5001 if elecdate==3538 & country_id==13
replace next_election=6464 if elecdate==5001 & country_id==13
replace next_election=7927 if elecdate==6464 & country_id==13
replace next_election=9383 if elecdate==7927 & country_id==13
replace next_election=10846 if elecdate==9383 & country_id==13
replace next_election=12309 if elecdate==10846 & country_id==13
replace next_election=13772 if elecdate==12309 & country_id==13
replace next_election=15228 if elecdate==13772 & country_id==13
replace next_election=16691 if elecdate==15228 & country_id==13
replace next_election=18154 if elecdate==16691 & country_id==13
replace next_election=19610 if elecdate==18154 & country_id==13
replace next_election=21073 if elecdate==19610 & country_id==13
replace next_election=21073+1463 if elecdate==21073 & country_id==13
 
replace next_election=7275 if elecdate==5959 & country_id==14
replace next_election=7583 if elecdate==7275 & country_id==14
replace next_election=8515 if elecdate==7583 & country_id==14
replace next_election=9410 if elecdate==8515 & country_id==14
replace next_election=10061 if elecdate==9410 & country_id==14
replace next_election=11601 if elecdate==10061 & country_id==14
replace next_election=13057 if elecdate==11601 & country_id==14
replace next_election=14527 if elecdate==13057 & country_id==14
replace next_election=15416 if elecdate==14527 & country_id==14
replace next_election=16487 if elecdate==15416 & country_id==14
replace next_election=18167 if elecdate==16487 & country_id==14
replace next_election=18783 if elecdate==18167 & country_id==14
replace next_election=20365 if elecdate==18783 & country_id==14
replace next_election=20365+1463 if elecdate==20365 & country_id==14
 
replace next_election=6999 if elecdate==6375 & country_id==15
replace next_election=8336 if elecdate==6999 & country_id==15
replace next_election=9669 if elecdate==8336 & country_id==15
replace next_election=10894 if elecdate==9669 & country_id==15
replace next_election=12210 if elecdate==10894 & country_id==15
replace next_election=13211 if elecdate==12210 & country_id==15
replace next_election=14681 if elecdate==13211 & country_id==15
replace next_election=16144 if elecdate==14681 & country_id==15
replace next_election=17600 if elecdate==16144 & country_id==15
replace next_election=18951 if elecdate==17600 & country_id==15
replace next_election=20442 if elecdate==18951 & country_id==15
replace next_election=20631 if elecdate==20442 & country_id==15
replace next_election=20631+1036 if elecdate==20631 & country_id==15

replace next_election=-4121 if elecdate==-5584 & country_id==16
replace next_election=-2658 if elecdate==-4121 & country_id==16
replace next_election=-1202 if elecdate==-2658 & country_id==16 
replace next_election=-579 if elecdate==-1202 & country_id==16
replace next_election=261 if elecdate==-579 & country_id==16
replace next_election=1724 if elecdate==261 & country_id==16
replace next_election=3180 if elecdate==1724 & country_id==16
replace next_election=3915 if elecdate==3180 & country_id==16
replace next_election=5007 if elecdate==3915 & country_id==16
replace next_election=6106 if elecdate==5007 & country_id==16
replace next_election=7198 if elecdate==6106 & country_id==16
replace next_election=8297 if elecdate==7198 & country_id==16
replace next_election=9389 if elecdate==8297 & country_id==16
replace next_election=10488 if elecdate==9389 & country_id==16
replace next_election=11580 if elecdate==10488 & country_id==16
replace next_election=12679 if elecdate==11580 & country_id==16
replace next_election=14142 if elecdate==12679 & country_id==16
replace next_election=15598 if elecdate==14142 & country_id==16
replace next_election=17061 if elecdate==15598 & country_id==16
replace next_election=18524 if elecdate==17061 & country_id==16
replace next_election=19980 if elecdate==18524 & country_id==16
replace next_election=21436 if elecdate==19980 & country_id==16

replace next_election=-3599 if elecdate==-5293 & country_id==17
replace next_election=-2990 if elecdate==-3599 & country_id==17
replace next_election=-1681 if elecdate==-2990 & country_id==17
replace next_election=-85 if elecdate==-1681 & country_id==17
replace next_election=1749 if elecdate==-85 & country_id==17
replace next_election=2281 if elecdate==1749 & country_id==17
replace next_election=3821 if elecdate==2281 & country_id==17
replace next_election=5172 if elecdate==3821 & country_id==17
replace next_election=5396 if elecdate==5172 & country_id==17
replace next_election=7062 if elecdate==5396 & country_id==17
replace next_election=8560 if elecdate==7062 & country_id==17
replace next_election=10023 if elecdate==8560 & country_id==17
replace next_election=11787 if elecdate==10023 & country_id==17
replace next_election=13635 if elecdate==11787 & country_id==17
replace next_election=15133 if elecdate==13635 & country_id==17
replace next_election=16561 if elecdate==15133 & country_id==17
replace next_election=18388 if elecdate==16561 & country_id==17
replace next_election=20215 if elecdate==18388 & country_id==17
replace next_election=20978 if elecdate==20215 & country_id==17
replace next_election=20978+917 if elecdate==20978 & country_id==17


gen year_of_election=.

replace year_of_election=1949 if next_election==-3736 & elecdate==-5150 & country_id==1
replace year_of_election=1953 if next_election==-2504 & elecdate==-3736 & country_id==1
replace year_of_election=1956 if next_election==-1328 & elecdate==-2504 & country_id==1
replace year_of_election=1959 if next_election==-236 & elecdate==-1328 & country_id==1
replace year_of_election=1962 if next_election==1052 & elecdate==-236 & country_id==1
replace year_of_election=1966 if next_election==2256 & elecdate==1052 & country_id==1
replace year_of_election=1970 if next_election==3712 & elecdate==2256 & country_id==1
replace year_of_election=1971 if next_election==4300 & elecdate==3712 & country_id==1
replace year_of_election=1975 if next_election==5756 & elecdate==4300 & country_id==1
replace year_of_election=1979 if next_election==7065 & elecdate==5756 & country_id==1
replace year_of_election=1983 if next_election==8514 & elecdate==7065 & country_id==1
replace year_of_election=1986 if next_election==9823 & elecdate==8514 & country_id==1
replace year_of_election=1990 if next_election==11237 & elecdate==9823 & country_id==1
replace year_of_election=1994 if next_election==12700 & elecdate==11237 & country_id==1
replace year_of_election=1995 if next_election==13134 & elecdate==12700 & country_id==1
replace year_of_election=1999 if next_election==14520 & elecdate==13134 & country_id==1
replace year_of_election=2002 if next_election==15668 & elecdate==14520 & country_id==1
replace year_of_election=2006 if next_election==17075 & elecdate==15668 & country_id==1
replace year_of_election=2008 if next_election==17803 & elecdate==17075 & country_id==1
replace year_of_election=2013 if next_election==19630 & elecdate==17803 & country_id==1
replace year_of_election=2017 if next_election==21107 & elecdate==19630 & country_id==1
replace year_of_election=2019 if next_election==21107+714 & elecdate==21107 & country_id==1

replace year_of_election=1949 if next_election==-3841 & elecdate==-5066 & country_id==2
replace year_of_election=1950 if next_election==-3498 & elecdate==-3841 & country_id==2
replace year_of_election=1954 if next_election==-2091 & elecdate==-3498 & country_id==2
replace year_of_election=1958 if next_election==-579 & elecdate==-2091 & country_id==2
replace year_of_election=1961 if next_election==450 & elecdate==-579 & country_id==2
replace year_of_election=1965 if next_election==1969 & elecdate==450 & country_id==2
replace year_of_election=1968 if next_election==3012 & elecdate==1969 & country_id==2
replace year_of_election=1971 if next_election==4328 & elecdate==3012 & country_id==2
replace year_of_election=1974 if next_election==5182 & elecdate==4328 & country_id==2
replace year_of_election=1977 if next_election==6316 & elecdate==5182 & country_id==2
replace year_of_election=1978 if next_election==6925 & elecdate==6316 & country_id==2
replace year_of_election=1981 if next_election==7982 & elecdate==6925 & country_id==2
replace year_of_election=1985 if next_election==9417 & elecdate==7982 & country_id==2
replace year_of_election=1987 if next_election==10208 & elecdate==9417 & country_id==2
replace year_of_election=1991 if next_election==11650 & elecdate==10208 & country_id==2
replace year_of_election=1995 if next_election==12924 & elecdate==11650 & country_id==2
replace year_of_election=1999 if next_election==14408 & elecdate==12924 & country_id==2
replace year_of_election=2003 if next_election==15843 & elecdate==14408 & country_id==2
replace year_of_election=2007 if next_election==17327 & elecdate==15843 & country_id==2
replace year_of_election=2010 if next_election==18426 & elecdate==17327 & country_id==2
replace year_of_election=2014 if next_election==19868 & elecdate==18426 & country_id==2
replace year_of_election=2019 if next_election==19868+1827 & elecdate==19868 & country_id==2

replace year_of_election=1947 if next_election==-4448 & elecdate==-5176 & country_id==3
replace year_of_election=1950 if next_election==-3405 & elecdate==-4448 & country_id==3
replace year_of_election=1953 if next_election==-2446 & elecdate==-3405 & country_id==3
replace year_of_election=1953 if next_election==-2292 & elecdate==-2446 & country_id==3
replace year_of_election=1957 if next_election==-962 & elecdate==-2292 & country_id==3
replace year_of_election=1960 if next_election==319 & elecdate==-962 & country_id==3
replace year_of_election=1964 if next_election==1726 & elecdate==319 & country_id==3
replace year_of_election=1966 if next_election==2517 & elecdate==1726 & country_id==3
replace year_of_election=1968 if next_election==2944 & elecdate==2517 & country_id==3
replace year_of_election=1971 if next_election==4281 & elecdate==2944 & country_id==3
replace year_of_election=1973 if next_election==5086 & elecdate==4281 & country_id==3
replace year_of_election=1975 if next_election==5487 & elecdate==5086 & country_id==3
replace year_of_election=1977 if next_election==6255 & elecdate==5487 & country_id==3
replace year_of_election=1979 if next_election==7235 & elecdate==6255 & country_id==3 
replace year_of_election=1981 if next_election==8012 & elecdate==7235 & country_id==3
replace year_of_election=1984 if next_election==8775 & elecdate==8012 & country_id==3
replace year_of_election=1987 if next_election==10112 & elecdate==8775 & country_id==3
replace year_of_election=1988 if next_election==10357 & elecdate==10112 & country_id==3
replace year_of_election=1990 if next_election==11303 & elecdate==10357 & country_id==3 
replace year_of_election=1994 if next_election==12682 & elecdate==11303 & country_id==3
replace year_of_election=1998 if next_election==13949 & elecdate==12682 & country_id==3
replace year_of_election=2001 if next_election==15299 & elecdate==13949 & country_id==3
replace year_of_election=2005 if next_election==16475 & elecdate==15299 & country_id==3
replace year_of_election=2007 if next_election==17483 & elecdate==16475 & country_id==3
replace year_of_election=2011 if next_election==18885 & elecdate==17483 & country_id==3
replace year_of_election=2015 if next_election==20257 & elecdate==18885 & country_id==3
replace year_of_election=2019 if next_election==20257+1448 & elecdate==20257 & country_id==3

replace year_of_election=1948 if next_election==-4200 & elecdate==-5402 & country_id==4
replace year_of_election=1951 if next_election==-3104 & elecdate==-4200 & country_id==4
replace year_of_election=1954 if next_election==-2125 & elecdate==-3104 & country_id==4
replace year_of_election=1958 if next_election==-543 & elecdate==-2125 & country_id==4 
replace year_of_election=1962 if next_election==766 & elecdate==-543 & country_id==4
replace year_of_election=1966 if next_election==2271 & elecdate==766 & country_id==4
replace year_of_election=1970 if next_election==3727 & elecdate==2271 & country_id==4
replace year_of_election=1972 if next_election==4385 & elecdate==3727 & country_id==4
replace year_of_election=1975 if next_election==5743 & elecdate==4385 & country_id==4
replace year_of_election=1979 if next_election==7017 & elecdate==5743 & country_id==4
replace year_of_election=1983 if next_election==8480 & elecdate==7017 & country_id==4
replace year_of_election=1987 if next_election==9936 & elecdate==8480 & country_id==4
replace year_of_election=1991 if next_election==11398 & elecdate==9936 & country_id==4
replace year_of_election=1995 if next_election==12861 & elecdate==11398 & country_id==4
replace year_of_election=1999 if next_election==14324 & elecdate==12861 & country_id==4
replace year_of_election=2003 if next_election==15780 & elecdate==14324 & country_id==4
replace year_of_election=2007 if next_election==17243 & elecdate==15780 & country_id==4
replace year_of_election=2011 if next_election==18734 & elecdate==17243 & country_id==4
replace year_of_election=2015 if next_election==20197 & elecdate==18734 & country_id==4
replace year_of_election=2019 if next_election==20197+1456 & elecdate==20197 & country_id==4

replace year_of_election=1962 if next_election==1059 & elecdate==-397 & country_id==5
replace year_of_election=1967 if next_election==2627 & elecdate==1059 & country_id==5
replace year_of_election=1968 if next_election==3103 & elecdate==2627 & country_id==5
replace year_of_election=1973 if next_election==4818 & elecdate==3103 & country_id==5
replace year_of_election=1978 if next_election==6652 & elecdate==4818 & country_id==5
replace year_of_election=1981 if next_election==7842 & elecdate==6652 & country_id==5
replace year_of_election=1986 if next_election==9571 & elecdate==7842 & country_id==5
replace year_of_election=1988 if next_election==10390 & elecdate==9571 & country_id==5
replace year_of_election=1993 if next_election==12140 & elecdate==10390 & country_id==5
replace year_of_election=1997 if next_election==13666 & elecdate==12140 & country_id==5
replace year_of_election=2002 if next_election==15507 & elecdate==13666 & country_id==5
replace year_of_election=2007 if next_election==17334 & elecdate==15507 & country_id==5
replace year_of_election=2012 if next_election==19161 & elecdate==17334 & country_id==5
replace year_of_election=2017 if next_election==20988 & elecdate==19161 & country_id==5

replace year_of_election=1953 if next_election==-2308 & elecdate==-3792 & country_id==6
replace year_of_election=1957 if next_election==-838 & elecdate==-2308 & country_id==6 
replace year_of_election=1961 if next_election==625 & elecdate==-838 & country_id==6
replace year_of_election=1965 if next_election==2088 & elecdate==625 & country_id==6
replace year_of_election=1969 if next_election==3558 & elecdate==2088 & country_id==6
replace year_of_election=1972 if next_election==4706 & elecdate==3558 & country_id==6
replace year_of_election=1976 if next_election==6120 & elecdate==4706 & country_id==6
replace year_of_election=1980 if next_election==7583 & elecdate==6120 & country_id==6
replace year_of_election=1983 if next_election==8465 & elecdate==7583 & country_id==6
replace year_of_election=1987 if next_election==9886 & elecdate==8465 & country_id==6
replace year_of_election=1990 if next_election==11293 & elecdate==9886 & country_id==6
replace year_of_election=1994 if next_election==12707 & elecdate==11293 & country_id==6
replace year_of_election=1998 if next_election==14149 & elecdate==12707 & country_id==6
replace year_of_election=2002 if next_election==15605 & elecdate==14149 & country_id==6
replace year_of_election=2005 if next_election==16697 & elecdate==15605 & country_id==6
replace year_of_election=2009 if next_election==18167 & elecdate==16697 & country_id==6
replace year_of_election=2013 if next_election==19623 & elecdate==18167 & country_id==6
replace year_of_election=2017 if next_election==21086 & elecdate==19623 & country_id==6
replace year_of_election=2021 if next_election==21086+1463 & elecdate==21086 & country_id==6

replace year_of_election=1981 if next_election==7961 & elecdate==6533 & country_id==7
replace year_of_election=1985 if next_election==9284 & elecdate==7961 & country_id==7
replace year_of_election=1989 if next_election==10761 & elecdate==9284 & country_id==7
replace year_of_election=1989 if next_election==10901 & elecdate==10761 & country_id==7
replace year_of_election=1990 if next_election==11055 & elecdate==10901 & country_id==7
replace year_of_election=1993 if next_election==12336 & elecdate==11055 & country_id==7
replace year_of_election=1996 if next_election==13414 & elecdate==12336 & country_id==7
replace year_of_election=2000 if next_election==14709 & elecdate==13414 & country_id==7
replace year_of_election=2004 if next_election==16137 & elecdate==14709 & country_id==7         
replace year_of_election=2007  if next_election==17425 & elecdate==16137 & country_id==7 
replace year_of_election=2009 if next_election==18174 & elecdate==17425 & country_id==7
replace year_of_election=2012 if next_election==19119 & elecdate==18174 & country_id==7
replace year_of_election=2012 if next_election==19161 & elecdate==19119 & country_id==7
replace year_of_election=2015 if next_election==20113 & elecdate==19161 & country_id==7
replace year_of_election=2015 if next_election==20351 & elecdate==20113 & country_id==7
replace year_of_election=2019 if next_election==20351+1386 & elecdate==20351 & country_id==7
 
replace year_of_election=1946 if next_election==-4933 & elecdate==-5552 & country_id==8
replace year_of_election=1949 if next_election==-3721 & elecdate==-4933 & country_id==8
replace year_of_election=1953 if next_election==-2378 & elecdate==-3721 & country_id==8
replace year_of_election=1956 if next_election==-1286 & elecdate==-2378 & country_id==8
replace year_of_election=1959 if next_election==-187 & elecdate==-1286 & country_id==8
replace year_of_election=1959 if next_election==-67 & elecdate==-187 & country_id==8
replace year_of_election=1963 if next_election==1255 & elecdate==-67 & country_id==8
replace year_of_election=1967 if next_election==2718 & elecdate==1255 & country_id==8
replace year_of_election=1971 if next_election==4181 & elecdate==2718 & country_id==8
replace year_of_election=1974 if next_election==5294 & elecdate==4181 & country_id==8
replace year_of_election=1978 if next_election==6750 & elecdate==5294 & country_id==8
replace year_of_election=1979 if next_election==7276 & elecdate==6750 & country_id==8
replace year_of_election=1983 if next_election==8513 & elecdate==7276 & country_id==8
replace year_of_election=1987 if next_election==9976 & elecdate==8513 & country_id==8
replace year_of_election=1991 if next_election==11432 & elecdate==9976 & country_id==8
replace year_of_election=1995 if next_election==12881 & elecdate==11432 & country_id==8
replace year_of_election=1999 if next_election==14372 & elecdate==12881 & country_id==8
replace year_of_election=2003 if next_election==15835 & elecdate==14372 & country_id==8
replace year_of_election=2007 if next_election==17298 & elecdate==15835 & country_id==8
replace year_of_election=2009 if next_election==18012 & elecdate==17298 & country_id==8
replace year_of_election=2013 if next_election==19475 & elecdate==18012 & country_id==8
replace year_of_election=2016 if next_election==20756 & elecdate==19475 & country_id==8
replace year_of_election=2017 if next_election==21120 & elecdate==20756 & country_id==8
replace year_of_election=2021 if next_election==21120+1428 & elecdate==21120 & country_id==8
 
replace year_of_election=1948 if next_election==-4349 & elecdate==-5694 & country_id==9
replace year_of_election=1951 if next_election==-3138 & elecdate==-4349 & country_id==9
replace year_of_election=1954 if next_election==-2054 & elecdate==-3138 & country_id==9
replace year_of_election=1957 if next_election==-1032 & elecdate==-2054 & country_id==9
replace year_of_election=1961 if next_election==642 & elecdate==-1032 & country_id==9
replace year_of_election=1965 if next_election==1923 & elecdate==642 & country_id==9
replace year_of_election=1969 if next_election==3456 & elecdate==1923 & country_id==9
replace year_of_election=1973 if next_election==4807 & elecdate==3456 & country_id==9
replace year_of_election=1977 if next_election==6376 & elecdate==4807 & country_id==9
replace year_of_election=1981 if next_election==7832 & elecdate==6376 & country_id==9
replace year_of_election=1982 if next_election==8084 & elecdate==7832 & country_id==9
replace year_of_election=1982 if next_election==8363 & elecdate==8084 & country_id==9
replace year_of_election=1987 if next_election==9909 & elecdate==8363 & country_id==9
replace year_of_election=1989 if next_election==10758 & elecdate==9909 & country_id==9
replace year_of_election=1992 if next_election==12017 & elecdate==10758 & country_id==9
replace year_of_election=1997 if next_election==13671 & elecdate==12017 & country_id==9
replace year_of_election=2002 if next_election==15477 & elecdate==13671 & country_id==9
replace year_of_election=2007 if next_election==17310 & elecdate==15477 & country_id==9
replace year_of_election=2011 if next_election==18683 & elecdate==17310 & country_id==9
replace year_of_election=2016 if next_election==20510 & elecdate==18683 & country_id==9
replace year_of_election=2020 if next_election==20510+1443 & elecdate==20510 & country_id==9

replace year_of_election=1948 if next_election==-4275 & elecdate==-4961 & country_id==10
replace year_of_election=1953 if next_election==-2399 & elecdate==-4275 & country_id==10
replace year_of_election=1958 if next_election==-586 & elecdate==-2399 & country_id==10
replace year_of_election=1963 if next_election==1213 & elecdate==-586 & country_id==10
replace year_of_election=1968 if next_election==3061 & elecdate==1213 & country_id==10
replace year_of_election=1972 if next_election==4510 & elecdate==3061 & country_id==10
replace year_of_election=1976 if next_election==6016 & elecdate==4510 & country_id==10
replace year_of_election=1979 if next_election==7093 & elecdate==6016 & country_id==10
replace year_of_election=1983 if next_election==8577 & elecdate==7093 & country_id==10
replace year_of_election=1987 if next_election==10026 & elecdate==8577 & country_id==10
replace year_of_election=1992 if next_election==11784 & elecdate==10026 & country_id==10
replace year_of_election=1994 if next_election==12505 & elecdate==11784 & country_id==10
replace year_of_election=1996 if next_election==13260 & elecdate==12505 & country_id==10
replace year_of_election=2001 if next_election==15108 & elecdate==13260 & country_id==10
replace year_of_election=2006 if next_election==16901 & elecdate==15108 & country_id==10
replace year_of_election=2008 if next_election==17636 & elecdate==16901 & country_id==10
replace year_of_election=2013 if next_election==19414 & elecdate==17636 & country_id==10
replace year_of_election=2018 if next_election==21247 & elecdate==19414 & country_id==10

replace year_of_election=1948 if next_election==-4195 & elecdate==-4977 & country_id==12
replace year_of_election=1952 if next_election==-2746 & elecdate==-4195 & country_id==12
replace year_of_election=1956 if next_election==-1297 & elecdate==-2746 & country_id==12  
replace year_of_election=1959 if next_election==-295 & elecdate==-1297 & country_id==12
replace year_of_election=1963 if next_election==1230 & elecdate==-295 & country_id==12
replace year_of_election=1967 if next_election==2602 & elecdate==1230 & country_id==12
replace year_of_election=1971 if next_election==4135 & elecdate==2602 & country_id==12
replace year_of_election=1972 if next_election==4716 & elecdate==4135 & country_id==12
replace year_of_election=1977 if next_election==6354 & elecdate==4716 & country_id==12
replace year_of_election=1981 if next_election==7816 & elecdate==6354 & country_id==12
replace year_of_election=1982 if next_election==8286 & elecdate==7816 & country_id==12
replace year_of_election=1986 if next_election==9637 & elecdate==8286 & country_id==12
replace year_of_election=1989 if next_election==10841 & elecdate==9637 & country_id==12
replace year_of_election=1994 if next_election==12541 & elecdate==10841 & country_id==12
replace year_of_election=1998 if next_election==14005 & elecdate==12541 & country_id==12
replace year_of_election=2002 if next_election==15475 & elecdate==14005 & country_id==12
replace year_of_election=2003 if next_election==15727 & elecdate==15475 & country_id==12
replace year_of_election=2006 if next_election==17127 & elecdate==15727 & country_id==12
replace year_of_election=2010 if next_election==18422 & elecdate==17127 & country_id==12
replace year_of_election=2012 if next_election==19248 & elecdate==18422 & country_id==12
replace year_of_election=2017 if next_election==20893 & elecdate==19248 & country_id==12
replace year_of_election=2021 if next_election==20893+1461 & elecdate==20893 & country_id==12

replace year_of_election=1949 if next_election==-3735 & elecdate==-5198 & country_id==13
replace year_of_election=1953 if next_election==-2272 & elecdate==-3735 & country_id==13
replace year_of_election=1957 if next_election==-816 & elecdate==-2272 & country_id==13
replace year_of_election=1961 if next_election==619 & elecdate==-816 & country_id==13
replace year_of_election=1965 if next_election==2082 & elecdate==619 & country_id==13
replace year_of_election=1969 if next_election==3538 & elecdate==2082 & country_id==13
replace year_of_election=1973 if next_election==5001 & elecdate==3538 & country_id==13
replace year_of_election=1977 if next_election==6464 & elecdate==5001 & country_id==13
replace year_of_election=1981 if next_election==7927 & elecdate==6464 & country_id==13
replace year_of_election=1985 if next_election==9383 & elecdate==7927 & country_id==13
replace year_of_election=1989 if next_election==10846 & elecdate==9383 & country_id==13
replace year_of_election=1993 if next_election==12309 & elecdate==10846 & country_id==13
replace year_of_election=1997 if next_election==13772 & elecdate==12309 & country_id==13
replace year_of_election=2001 if next_election==15228 & elecdate==13772 & country_id==13
replace year_of_election=2005 if next_election==16691 & elecdate==15228 & country_id==13
replace year_of_election=2009 if next_election==18154 & elecdate==16691 & country_id==13
replace year_of_election=2013 if next_election==19610 & elecdate==18154 & country_id==13
replace year_of_election=2017 if next_election==21073 & elecdate==19610 & country_id==13
replace year_of_election=2021 if next_election==21073+1463 & elecdate==21073 & country_id==13
 
replace year_of_election=1979 if next_election==7275 & elecdate==5959 & country_id==14
replace year_of_election=1980 if next_election==7583 & elecdate==7275 & country_id==14
replace year_of_election=1983 if next_election==8515 & elecdate==7583 & country_id==14
replace year_of_election=1985 if next_election==9410 & elecdate==8515 & country_id==14
replace year_of_election=1987 if next_election==10061 & elecdate==9410 & country_id==14
replace year_of_election=1991 if next_election==11601 & elecdate==10061 & country_id==14
replace year_of_election=1995 if next_election==13057 & elecdate==11601 & country_id==14
replace year_of_election=1999 if next_election==14527 & elecdate==13057 & country_id==14
replace year_of_election=2002 if next_election==15416 & elecdate==14527 & country_id==14
replace year_of_election=2005 if next_election==16487 & elecdate==15416 & country_id==14
replace year_of_election=2009 if next_election==18167 & elecdate==16487 & country_id==14
replace year_of_election=2011 if next_election==18783 & elecdate==18167 & country_id==14
replace year_of_election=2015 if next_election==20365 & elecdate==18783 & country_id==14
replace year_of_election=2019 if next_election==20365+1463 & elecdate==20365 & country_id==14
 
replace year_of_election=1979 if next_election==6999 & elecdate==6375 & country_id==15
replace year_of_election=1982 if next_election==8336 & elecdate==6999 & country_id==15
replace year_of_election=1986 if next_election==9669 & elecdate==8336 & country_id==15
replace year_of_election=1989 if next_election==10894 & elecdate==9669 & country_id==15
replace year_of_election=1993 if next_election==12210 & elecdate==10894 & country_id==15
replace year_of_election=1996 if next_election==13211 & elecdate==12210 & country_id==15
replace year_of_election=2000 if next_election==14681 & elecdate==13211 & country_id==15
replace year_of_election=2004 if next_election==16144 & elecdate==14681 & country_id==15
replace year_of_election=2008 if next_election==17600 & elecdate==16144 & country_id==15
replace year_of_election=2011 if next_election==18951 & elecdate==17600 & country_id==15
replace year_of_election=2015 if next_election==20442 & elecdate==18951 & country_id==15
replace year_of_election=2016 if next_election==20631 & elecdate==20442 & country_id==15
replace year_of_election=2019 if next_election==20631+1036 & elecdate==20631 & country_id==15

replace year_of_election=1948 if next_election==-4121 & elecdate==-5584 & country_id==16
replace year_of_election=1952 if next_election==-2658 & elecdate==-4121 & country_id==16
replace year_of_election=1956 if next_election==-1202 & elecdate==-2658 & country_id==16 
replace year_of_election=1958 if next_election==-579 & elecdate==-1202 & country_id==16
replace year_of_election=1960 if next_election==261 & elecdate==-579 & country_id==16
replace year_of_election=1964 if next_election==1724 & elecdate==261 & country_id==16
replace year_of_election=1968 if next_election==3180 & elecdate==1724 & country_id==16
replace year_of_election=1970 if next_election==3915 & elecdate==3180 & country_id==16
replace year_of_election=1973 if next_election==5007 & elecdate==3915 & country_id==16
replace year_of_election=1976 if next_election==6106 & elecdate==5007 & country_id==16
replace year_of_election=1979 if next_election==7198 & elecdate==6106 & country_id==16
replace year_of_election=1982 if next_election==8297 & elecdate==7198 & country_id==16
replace year_of_election=1985 if next_election==9389 & elecdate==8297 & country_id==16
replace year_of_election=1988 if next_election==10488 & elecdate==9389 & country_id==16
replace year_of_election=1991 if next_election==11580 & elecdate==10488 & country_id==16
replace year_of_election=1994 if next_election==12679 & elecdate==11580 & country_id==16
replace year_of_election=1998 if next_election==14142 & elecdate==12679 & country_id==16
replace year_of_election=2002 if next_election==15598 & elecdate==14142 & country_id==16
replace year_of_election=2006 if next_election==17061 & elecdate==15598 & country_id==16
replace year_of_election=2010 if next_election==18524 & elecdate==17061 & country_id==16
replace year_of_election=2014 if next_election==19980 & elecdate==18524 & country_id==16
replace year_of_election=2018 if next_election==21436 & elecdate==19980 & country_id==16

replace year_of_election=1950 if next_election==-3599 & elecdate==-5293 & country_id==17
replace year_of_election=1951 if next_election==-2990 & elecdate==-3599 & country_id==17
replace year_of_election=1955 if next_election==-1681 & elecdate==-2990 & country_id==17
replace year_of_election=1959 if next_election==-85 & elecdate==-1681 & country_id==17
replace year_of_election=1964 if next_election==1749 & elecdate==-85 & country_id==17
replace year_of_election=1966 if next_election==2281 & elecdate==1749 & country_id==17
replace year_of_election=1970 if next_election==3821 & elecdate==2281 & country_id==17
replace year_of_election=1974 if next_election==5172 & elecdate==3821 & country_id==17
replace year_of_election=1974 if next_election==5396 & elecdate==5172 & country_id==17
replace year_of_election=1979 if next_election==7062 & elecdate==5396 & country_id==17
replace year_of_election=1983 if next_election==8560 & elecdate==7062 & country_id==17
replace year_of_election=1987 if next_election==10023 & elecdate==8560 & country_id==17
replace year_of_election=1992 if next_election==11787 & elecdate==10023 & country_id==17
replace year_of_election=1997 if next_election==13635 & elecdate==11787 & country_id==17
replace year_of_election=2001 if next_election==15133 & elecdate==13635 & country_id==17
replace year_of_election=2005 if next_election==16561 & elecdate==15133 & country_id==17
replace year_of_election=2010 if next_election==18388 & elecdate==16561 & country_id==17
replace year_of_election=2015 if next_election==20215 & elecdate==18388 & country_id==17
replace year_of_election=2017 if next_election==20978 & elecdate==20215 & country_id==17
replace year_of_election=2019 if next_election==20978+917 & elecdate==20978 & country_id==17

gen month_of_election=.

replace month_of_election=10 if next_election==-3736 & elecdate==-5150 & country_id==1
replace month_of_election=2 if next_election==-2504 & elecdate==-3736 & country_id==1
replace month_of_election=5 if next_election==-1328 & elecdate==-2504 & country_id==1
replace month_of_election=5 if next_election==-236 & elecdate==-1328 & country_id==1
replace month_of_election=11 if next_election==1052 & elecdate==-236 & country_id==1
replace month_of_election=3 if next_election==2256 & elecdate==1052 & country_id==1
replace month_of_election=3 if next_election==3712 & elecdate==2256 & country_id==1
replace month_of_election=10 if next_election==4300 & elecdate==3712 & country_id==1
replace month_of_election=10 if next_election==5756 & elecdate==4300 & country_id==1
replace month_of_election=5 if next_election==7065 & elecdate==5756 & country_id==1
replace month_of_election=4 if next_election==8514 & elecdate==7065 & country_id==1
replace month_of_election=11 if next_election==9823 & elecdate==8514 & country_id==1
replace month_of_election=10 if next_election==11237 & elecdate==9823 & country_id==1
replace month_of_election=10 if next_election==12700 & elecdate==11237 & country_id==1
replace month_of_election=12 if next_election==13134 & elecdate==12700 & country_id==1
replace month_of_election=10 if next_election==14520 & elecdate==13134 & country_id==1
replace month_of_election=11 if next_election==15668 & elecdate==14520 & country_id==1
replace month_of_election=10 if next_election==17075 & elecdate==15668 & country_id==1
replace month_of_election=9 if next_election==17803 & elecdate==17075 & country_id==1
replace month_of_election=9 if next_election==19630 & elecdate==17803 & country_id==1
replace month_of_election=10 if next_election==21107 & elecdate==19630 & country_id==1
replace month_of_election=9 if next_election==21107+714 & elecdate==21107 & country_id==1

replace month_of_election=6 if next_election==-3841 & elecdate==-5066 & country_id==2
replace month_of_election=6 if next_election==-3498 & elecdate==-3841 & country_id==2
replace month_of_election=4 if next_election==-2091 & elecdate==-3498 & country_id==2
replace month_of_election=6 if next_election==-579 & elecdate==-2091 & country_id==2
replace month_of_election=3 if next_election==450 & elecdate==-579 & country_id==2
replace month_of_election=5 if next_election==1969 & elecdate==450 & country_id==2
replace month_of_election=3 if next_election==3012 & elecdate==1969 & country_id==2
replace month_of_election=11 if next_election==4328 & elecdate==3012 & country_id==2
replace month_of_election=3 if next_election==5182 & elecdate==4328 & country_id==2
replace month_of_election=4 if next_election==6316 & elecdate==5182 & country_id==2
replace month_of_election=12 if next_election==6925 & elecdate==6316 & country_id==2
replace month_of_election=11 if next_election==7982 & elecdate==6925 & country_id==2
replace month_of_election=10 if next_election==9417 & elecdate==7982 & country_id==2
replace month_of_election=12 if next_election==10208 & elecdate==9417 & country_id==2
replace month_of_election=11 if next_election==11650 & elecdate==10208 & country_id==2
replace month_of_election=5 if next_election==12924 & elecdate==11650 & country_id==2
replace month_of_election=6 if next_election==14408 & elecdate==12924 & country_id==2
replace month_of_election=5 if next_election==15843 & elecdate==14408 & country_id==2
replace month_of_election=6 if next_election==17327 & elecdate==15843 & country_id==2
replace month_of_election=6 if next_election==18426 & elecdate==17327 & country_id==2
replace month_of_election=5 if next_election==19868 & elecdate==18426 & country_id==2
replace month_of_election=5 if next_election==19868+1827 & elecdate==19868 & country_id==2

replace month_of_election=10 if next_election==-4448 & elecdate==-5176 & country_id==3
replace month_of_election=9 if next_election==-3405 & elecdate==-4448 & country_id==3
replace month_of_election=4 if next_election==-2446 & elecdate==-3405 & country_id==3
replace month_of_election=9 if next_election==-2292 & elecdate==-2446 & country_id==3
replace month_of_election=5 if next_election==-962 & elecdate==-2292 & country_id==3
replace month_of_election=11 if next_election==319 & elecdate==-962 & country_id==3
replace month_of_election=9 if next_election==1726 & elecdate==319 & country_id==3
replace month_of_election=11 if next_election==2517 & elecdate==1726 & country_id==3
replace month_of_election=1 if next_election==2944 & elecdate==2517 & country_id==3
replace month_of_election=9 if next_election==4281 & elecdate==2944 & country_id==3
replace month_of_election=12 if next_election==5086 & elecdate==4281 & country_id==3
replace month_of_election=1 if next_election==5487 & elecdate==5086 & country_id==3
replace month_of_election=2 if next_election==6255 & elecdate==5487 & country_id==3
replace month_of_election=10 if next_election==7235 & elecdate==6255 & country_id==3 
replace month_of_election=12 if next_election==8012 & elecdate==7235 & country_id==3
replace month_of_election=1 if next_election==8775 & elecdate==8012 & country_id==3
replace month_of_election=9 if next_election==10112 & elecdate==8775 & country_id==3
replace month_of_election=5 if next_election==10357 & elecdate==10112 & country_id==3
replace month_of_election=12 if next_election==11303 & elecdate==10357 & country_id==3 
replace month_of_election=9 if next_election==12682 & elecdate==11303 & country_id==3
replace month_of_election=3 if next_election==13949 & elecdate==12682 & country_id==3
replace month_of_election=11 if next_election==15299 & elecdate==13949 & country_id==3
replace month_of_election=2 if next_election==16475 & elecdate==15299 & country_id==3
replace month_of_election=11 if next_election==17483 & elecdate==16475 & country_id==3
replace month_of_election=9 if next_election==18885 & elecdate==17483 & country_id==3
replace month_of_election=6 if next_election==20257 & elecdate==18885 & country_id==3
replace month_of_election=6 if next_election==20257+1448 & elecdate==20257 & country_id==3

replace month_of_election=7 if next_election==-4200 & elecdate==-5402 & country_id==4
replace month_of_election=7 if next_election==-3104 & elecdate==-4200 & country_id==4
replace month_of_election=3 if next_election==-2125 & elecdate==-3104 & country_id==4
replace month_of_election=7 if next_election==-543 & elecdate==-2125 & country_id==4 
replace month_of_election=2 if next_election==766 & elecdate==-543 & country_id==4
replace month_of_election=3 if next_election==2271 & elecdate==766 & country_id==4
replace month_of_election=3 if next_election==3727 & elecdate==2271 & country_id==4
replace month_of_election=1 if next_election==4385 & elecdate==3727 & country_id==4
replace month_of_election=9 if next_election==5743 & elecdate==4385 & country_id==4
replace month_of_election=3 if next_election==7017 & elecdate==5743 & country_id==4
replace month_of_election=3 if next_election==8480 & elecdate==7017 & country_id==4
replace month_of_election=3 if next_election==9936 & elecdate==8480 & country_id==4
replace month_of_election=3 if next_election==11398 & elecdate==9936 & country_id==4
replace month_of_election=3 if next_election==12861 & elecdate==11398 & country_id==4
replace month_of_election=3 if next_election==14324 & elecdate==12861 & country_id==4
replace month_of_election=3 if next_election==15780 & elecdate==14324 & country_id==4
replace month_of_election=3 if next_election==17243 & elecdate==15780 & country_id==4
replace month_of_election=4 if next_election==18734 & elecdate==17243 & country_id==4
replace month_of_election=4 if next_election==20197 & elecdate==18734 & country_id==4
replace month_of_election=4 if next_election==20197+1456 & elecdate==20197 & country_id==4

replace month_of_election=11 if next_election==1059 & elecdate==-397 & country_id==5
replace month_of_election=3 if next_election==2627 & elecdate==1059 & country_id==5
replace month_of_election=6 if next_election==3103 & elecdate==2627 & country_id==5
replace month_of_election=3 if next_election==4818 & elecdate==3103 & country_id==5
replace month_of_election=3 if next_election==6652 & elecdate==4818 & country_id==5
replace month_of_election=6 if next_election==7842 & elecdate==6652 & country_id==5
replace month_of_election=3 if next_election==9571 & elecdate==7842 & country_id==5
replace month_of_election=6 if next_election==10390 & elecdate==9571 & country_id==5
replace month_of_election=4 if next_election==12140 & elecdate==10390 & country_id==5
replace month_of_election=6 if next_election==13666 & elecdate==12140 & country_id==5
replace month_of_election=6 if next_election==15507 & elecdate==13666 & country_id==5
replace month_of_election=6 if next_election==17334 & elecdate==15507 & country_id==5
replace month_of_election=6 if next_election==19161 & elecdate==17334 & country_id==5
replace month_of_election=6 if next_election==20988 & elecdate==19161 & country_id==5
 
replace month_of_election=9 if next_election==-2308 & elecdate==-3792 & country_id==6
replace month_of_election=9 if next_election==-838 & elecdate==-2308 & country_id==6 
replace month_of_election=9 if next_election==625 & elecdate==-838 & country_id==6
replace month_of_election=9 if next_election==2088 & elecdate==625 & country_id==6
replace month_of_election=9 if next_election==3558 & elecdate==2088 & country_id==6
replace month_of_election=11 if next_election==4706 & elecdate==3558 & country_id==6
replace month_of_election=10 if next_election==6120 & elecdate==4706 & country_id==6
replace month_of_election=10 if next_election==7583 & elecdate==6120 & country_id==6
replace month_of_election=3 if next_election==8465 & elecdate==7583 & country_id==6
replace month_of_election=1 if next_election==9886 & elecdate==8465 & country_id==6
replace month_of_election=12 if next_election==11293 & elecdate==9886 & country_id==6
replace month_of_election=10 if next_election==12707 & elecdate==11293 & country_id==6
replace month_of_election=9 if next_election==14149 & elecdate==12707 & country_id==6
replace month_of_election=9 if next_election==15605 & elecdate==14149 & country_id==6
replace month_of_election=9 if next_election==16697 & elecdate==15605 & country_id==6
replace month_of_election=9 if next_election==18167 & elecdate==16697 & country_id==6
replace month_of_election=9 if next_election==19623 & elecdate==18167 & country_id==6
replace month_of_election=9 if next_election==21086 & elecdate==19623 & country_id==6
replace month_of_election=9 if next_election==21086+1463 & elecdate==21086 & country_id==6

replace month_of_election=10 if next_election==7961 & elecdate==6533 & country_id==7
replace month_of_election=6 if next_election==9284 & elecdate==7961 & country_id==7
replace month_of_election=6 if next_election==10761 & elecdate==9284 & country_id==7
replace month_of_election=11 if next_election==10901 & elecdate==10761 & country_id==7
replace month_of_election=4 if next_election==11055 & elecdate==10901 & country_id==7
replace month_of_election=10 if next_election==12336 & elecdate==11055 & country_id==7
replace month_of_election=9 if next_election==13414 & elecdate==12336 & country_id==7
replace month_of_election=4 if next_election==14709 & elecdate==13414 & country_id==7
replace month_of_election=3 if next_election==16137 & elecdate==14709 & country_id==7         
replace month_of_election=9 if next_election==17425 & elecdate==16137 & country_id==7 
replace month_of_election=10 if next_election==18174 & elecdate==17425 & country_id==7
replace month_of_election=5 if next_election==19119 & elecdate==18174 & country_id==7
replace month_of_election=6 if next_election==19161 & elecdate==19119 & country_id==7
replace month_of_election=1 if next_election==20113 & elecdate==19161 & country_id==7
replace month_of_election=9 if next_election==20351 & elecdate==20113 & country_id==7
replace month_of_election=7 if next_election==20351+1386 & elecdate==20351 & country_id==7
 
replace month_of_election=6 if next_election==-4933 & elecdate==-5552 & country_id==8
replace month_of_election=10 if next_election==-3721 & elecdate==-4933 & country_id==8
replace month_of_election=6 if next_election==-2378 & elecdate==-3721 & country_id==8
replace month_of_election=6 if next_election==-1286 & elecdate==-2378 & country_id==8
replace month_of_election=6 if next_election==-187 & elecdate==-1286 & country_id==8
replace month_of_election=10 if next_election==-67 & elecdate==-187 & country_id==8
replace month_of_election=6 if next_election==1255 & elecdate==-67 & country_id==8
replace month_of_election=6 if next_election==2718 & elecdate==1255 & country_id==8
replace month_of_election=6 if next_election==4181 & elecdate==2718 & country_id==8
replace month_of_election=6 if next_election==5294 & elecdate==4181 & country_id==8
replace month_of_election=6 if next_election==6750 & elecdate==5294 & country_id==8
replace month_of_election=12 if next_election==7276 & elecdate==6750 & country_id==8
replace month_of_election=4 if next_election==8513 & elecdate==7276 & country_id==8
replace month_of_election=4 if next_election==9976 & elecdate==8513 & country_id==8
replace month_of_election=4 if next_election==11432 & elecdate==9976 & country_id==8
replace month_of_election=4 if next_election==12881 & elecdate==11432 & country_id==8
replace month_of_election=5 if next_election==14372 & elecdate==12881 & country_id==8
replace month_of_election=5 if next_election==15835 & elecdate==14372 & country_id==8
replace month_of_election=5 if next_election==17298 & elecdate==15835 & country_id==8
replace month_of_election=4 if next_election==18012 & elecdate==17298 & country_id==8
replace month_of_election=4 if next_election==19475 & elecdate==18012 & country_id==8
replace month_of_election=10 if next_election==20756 & elecdate==19475 & country_id==8
replace month_of_election=10 if next_election==21120 & elecdate==20756 & country_id==8
replace month_of_election=9 if next_election==21120+1428 & elecdate==21120 & country_id==8
 
replace month_of_election=2 if next_election==-4349 & elecdate==-5694 & country_id==9
replace month_of_election=5 if next_election==-3138 & elecdate==-4349 & country_id==9
replace month_of_election=5 if next_election==-2054 & elecdate==-3138 & country_id==9
replace month_of_election=3 if next_election==-1032 & elecdate==-2054 & country_id==9
replace month_of_election=10 if next_election==642 & elecdate==-1032 & country_id==9
replace month_of_election=4 if next_election==1923 & elecdate==642 & country_id==9
replace month_of_election=6 if next_election==3456 & elecdate==1923 & country_id==9
replace month_of_election=2 if next_election==4807 & elecdate==3456 & country_id==9
replace month_of_election=6 if next_election==6376 & elecdate==4807 & country_id==9
replace month_of_election=6 if next_election==7832 & elecdate==6376 & country_id==9
replace month_of_election=2 if next_election==8084 & elecdate==7832 & country_id==9
replace month_of_election=11 if next_election==8363 & elecdate==8084 & country_id==9
replace month_of_election=2 if next_election==9909 & elecdate==8363 & country_id==9
replace month_of_election=6 if next_election==10758 & elecdate==9909 & country_id==9
replace month_of_election=11 if next_election==12017 & elecdate==10758 & country_id==9
replace month_of_election=6 if next_election==13671 & elecdate==12017 & country_id==9
replace month_of_election=5 if next_election==15477 & elecdate==13671 & country_id==9
replace month_of_election=5 if next_election==17310 & elecdate==15477 & country_id==9
replace month_of_election=2 if next_election==18683 & elecdate==17310 & country_id==9
replace month_of_election=2 if next_election==20510 & elecdate==18683 & country_id==9
replace month_of_election=2 if next_election==20510+1443 & elecdate==20510 & country_id==9

replace month_of_election=4 if next_election==-4275 & elecdate==-4961 & country_id==10
replace month_of_election=6 if next_election==-2399 & elecdate==-4275 & country_id==10
replace month_of_election=5 if next_election==-586 & elecdate==-2399 & country_id==10
replace month_of_election=4 if next_election==1213 & elecdate==-586 & country_id==10
replace month_of_election=5 if next_election==3061 & elecdate==1213 & country_id==10
replace month_of_election=5 if next_election==4510 & elecdate==3061 & country_id==10
replace month_of_election=6 if next_election==6016 & elecdate==4510 & country_id==10
replace month_of_election=6 if next_election==7093 & elecdate==6016 & country_id==10
replace month_of_election=6 if next_election==8577 & elecdate==7093 & country_id==10
replace month_of_election=6 if next_election==10026 & elecdate==8577 & country_id==10
replace month_of_election=4 if next_election==11784 & elecdate==10026 & country_id==10
replace month_of_election=3 if next_election==12505 & elecdate==11784 & country_id==10
replace month_of_election=4 if next_election==13260 & elecdate==12505 & country_id==10
replace month_of_election=5 if next_election==15108 & elecdate==13260 & country_id==10
replace month_of_election=4 if next_election==16901 & elecdate==15108 & country_id==10
replace month_of_election=4 if next_election==17636 & elecdate==16901 & country_id==10
replace month_of_election=2 if next_election==19414 & elecdate==17636 & country_id==10
replace month_of_election=3 if next_election==21247 & elecdate==19414 & country_id==10

replace month_of_election=7 if next_election==-4195 & elecdate==-4977 & country_id==12
replace month_of_election=6 if next_election==-2746 & elecdate==-4195 & country_id==12
replace month_of_election=6 if next_election==-1297 & elecdate==-2746 & country_id==12  
replace month_of_election=3 if next_election==-295 & elecdate==-1297 & country_id==12
replace month_of_election=5 if next_election==1230 & elecdate==-295 & country_id==12
replace month_of_election=2 if next_election==2602 & elecdate==1230 & country_id==12
replace month_of_election=4 if next_election==4135 & elecdate==2602 & country_id==12
replace month_of_election=11 if next_election==4716 & elecdate==4135 & country_id==12
replace month_of_election=5 if next_election==6354 & elecdate==4716 & country_id==12
replace month_of_election=5 if next_election==7816 & elecdate==6354 & country_id==12
replace month_of_election=9 if next_election==8286 & elecdate==7816 & country_id==12
replace month_of_election=5 if next_election==9637 & elecdate==8286 & country_id==12
replace month_of_election=9 if next_election==10841 & elecdate==9637 & country_id==12
replace month_of_election=5 if next_election==12541 & elecdate==10841 & country_id==12
replace month_of_election=5 if next_election==14005 & elecdate==12541 & country_id==12
replace month_of_election=5 if next_election==15475 & elecdate==14005 & country_id==12
replace month_of_election=1 if next_election==15727 & elecdate==15475 & country_id==12
replace month_of_election=11 if next_election==17127 & elecdate==15727 & country_id==12
replace month_of_election=6 if next_election==18422 & elecdate==17127 & country_id==12
replace month_of_election=9 if next_election==19248 & elecdate==18422 & country_id==12
replace month_of_election=3 if next_election==20893 & elecdate==19248 & country_id==12
replace month_of_election=3 if next_election==20893+1461 & elecdate==20893 & country_id==12

replace month_of_election=10 if next_election==-3735 & elecdate==-5198 & country_id==13
replace month_of_election=10 if next_election==-2272 & elecdate==-3735 & country_id==13
replace month_of_election=10 if next_election==-816 & elecdate==-2272 & country_id==13
replace month_of_election=9 if next_election==619 & elecdate==-816 & country_id==13
replace month_of_election=9 if next_election==2082 & elecdate==619 & country_id==13
replace month_of_election=9 if next_election==3538 & elecdate==2082 & country_id==13
replace month_of_election=9 if next_election==5001 & elecdate==3538 & country_id==13
replace month_of_election=9 if next_election==6464 & elecdate==5001 & country_id==13
replace month_of_election=9 if next_election==7927 & elecdate==6464 & country_id==13
replace month_of_election=9 if next_election==9383 & elecdate==7927 & country_id==13
replace month_of_election=9 if next_election==10846 & elecdate==9383 & country_id==13
replace month_of_election=9 if next_election==12309 & elecdate==10846 & country_id==13
replace month_of_election=9 if next_election==13772 & elecdate==12309 & country_id==13
replace month_of_election=9 if next_election==15228 & elecdate==13772 & country_id==13
replace month_of_election=9 if next_election==16691 & elecdate==15228 & country_id==13
replace month_of_election=9 if next_election==18154 & elecdate==16691 & country_id==13
replace month_of_election=9 if next_election==19610 & elecdate==18154 & country_id==13
replace month_of_election=9 if next_election==21073 & elecdate==19610 & country_id==13
replace month_of_election=9 if next_election==21073+1463 & elecdate==21073 & country_id==13
 
replace month_of_election=12 if next_election==7275 & elecdate==5959 & country_id==14
replace month_of_election=10 if next_election==7583 & elecdate==7275 & country_id==14
replace month_of_election=4 if next_election==8515 & elecdate==7583 & country_id==14
replace month_of_election=10 if next_election==9410 & elecdate==8515 & country_id==14
replace month_of_election=7 if next_election==10061 & elecdate==9410 & country_id==14
replace month_of_election=10 if next_election==11601 & elecdate==10061 & country_id==14
replace month_of_election=10 if next_election==13057 & elecdate==11601 & country_id==14
replace month_of_election=10 if next_election==14527 & elecdate==13057 & country_id==14
replace month_of_election=3 if next_election==15416 & elecdate==14527 & country_id==14
replace month_of_election=2 if next_election==16487 & elecdate==15416 & country_id==14
replace month_of_election=9 if next_election==18167 & elecdate==16487 & country_id==14
replace month_of_election=6 if next_election==18783 & elecdate==18167 & country_id==14
replace month_of_election=10 if next_election==20365 & elecdate==18783 & country_id==14
replace month_of_election=10 if next_election==20365+1463 & elecdate==20365 & country_id==14
 
replace month_of_election=3 if next_election==6999 & elecdate==6375 & country_id==15
replace month_of_election=10 if next_election==8336 & elecdate==6999 & country_id==15
replace month_of_election=6 if next_election==9669 & elecdate==8336 & country_id==15
replace month_of_election=10 if next_election==10894 & elecdate==9669 & country_id==15
replace month_of_election=6 if next_election==12210 & elecdate==10894 & country_id==15
replace month_of_election=3 if next_election==13211 & elecdate==12210 & country_id==15
replace month_of_election=3 if next_election==14681 & elecdate==13211 & country_id==15
replace month_of_election=3 if next_election==16144 & elecdate==14681 & country_id==15
replace month_of_election=3 if next_election==17600 & elecdate==16144 & country_id==15
replace month_of_election=11 if next_election==18951 & elecdate==17600 & country_id==15
replace month_of_election=12 if next_election==20442 & elecdate==18951 & country_id==15
replace month_of_election=6 if next_election==20631 & elecdate==20442 & country_id==15
replace month_of_election=4 if next_election==20631+1036 & elecdate==20631 & country_id==15

replace month_of_election=9 if next_election==-4121 & elecdate==-5584 & country_id==16
replace month_of_election=9 if next_election==-2658 & elecdate==-4121 & country_id==16
replace month_of_election=9 if next_election==-1202 & elecdate==-2658 & country_id==16 
replace month_of_election=9 if next_election==-579 & elecdate==-1202 & country_id==16
replace month_of_election=9 if next_election==261 & elecdate==-579 & country_id==16
replace month_of_election=9 if next_election==1724 & elecdate==261 & country_id==16
replace month_of_election=9 if next_election==3180 & elecdate==1724 & country_id==16
replace month_of_election=9 if next_election==3915 & elecdate==3180 & country_id==16
replace month_of_election=9 if next_election==5007 & elecdate==3915 & country_id==16
replace month_of_election=9 if next_election==6106 & elecdate==5007 & country_id==16
replace month_of_election=9 if next_election==7198 & elecdate==6106 & country_id==16
replace month_of_election=9 if next_election==8297 & elecdate==7198 & country_id==16
replace month_of_election=9 if next_election==9389 & elecdate==8297 & country_id==16
replace month_of_election=9 if next_election==10488 & elecdate==9389 & country_id==16
replace month_of_election=9 if next_election==11580 & elecdate==10488 & country_id==16
replace month_of_election=9 if next_election==12679 & elecdate==11580 & country_id==16
replace month_of_election=9 if next_election==14142 & elecdate==12679 & country_id==16
replace month_of_election=9 if next_election==15598 & elecdate==14142 & country_id==16
replace month_of_election=9 if next_election==17061 & elecdate==15598 & country_id==16
replace month_of_election=9 if next_election==18524 & elecdate==17061 & country_id==16
replace month_of_election=9 if next_election==19980 & elecdate==18524 & country_id==16
replace month_of_election=9 if next_election==21436 & elecdate==19980 & country_id==16

replace month_of_election=2 if next_election==-3599 & elecdate==-5293 & country_id==17
replace month_of_election=10 if next_election==-2990 & elecdate==-3599 & country_id==17
replace month_of_election=5 if next_election==-1681 & elecdate==-2990 & country_id==17
replace month_of_election=10 if next_election==-85 & elecdate==-1681 & country_id==17
replace month_of_election=10 if next_election==1749 & elecdate==-85 & country_id==17
replace month_of_election=3 if next_election==2281 & elecdate==1749 & country_id==17
replace month_of_election=6 if next_election==3821 & elecdate==2281 & country_id==17
replace month_of_election=2 if next_election==5172 & elecdate==3821 & country_id==17
replace month_of_election=10 if next_election==5396 & elecdate==5172 & country_id==17
replace month_of_election=5 if next_election==7062 & elecdate==5396 & country_id==17
replace month_of_election=6 if next_election==8560 & elecdate==7062 & country_id==17
replace month_of_election=6 if next_election==10023 & elecdate==8560 & country_id==17
replace month_of_election=4 if next_election==11787 & elecdate==10023 & country_id==17
replace month_of_election=5 if next_election==13635 & elecdate==11787 & country_id==17
replace month_of_election=6 if next_election==15133 & elecdate==13635 & country_id==17
replace month_of_election=5 if next_election==16561 & elecdate==15133 & country_id==17
replace month_of_election=5 if next_election==18388 & elecdate==16561 & country_id==17
replace month_of_election=5 if next_election==20215 & elecdate==18388 & country_id==17
replace month_of_election=6 if next_election==20978 & elecdate==20215 & country_id==17
replace month_of_election=12 if next_election==20978+917 & elecdate==20978 & country_id==17

gen latterhalf_yearofelection=1 if month_of_election>6 & month_of_election<13
replace latterhalf_yearofelection=0 if month_of_election<7

gen GDPyear_election=year_of_election if latterhalf_yearofelection==1
replace GDPyear_election=year_of_election-1 if latterhalf_yearofelection==0

***** PER CAPITA GDP GROWTH RATE, NEXT ELECTION *****

gen GDPgrowthratepp=.

replace GDPgrowthratepp=19.13893 if GDPyear_election==1949 & country_id==1
replace GDPgrowthratepp=.2020712 if GDPyear_election==1952 & country_id==1
replace GDPgrowthratepp=11.34328 if GDPyear_election==1955 & country_id==1
replace GDPgrowthratepp=3.339614 if GDPyear_election==1958 & country_id==1
replace GDPgrowthratepp=2.021469667 if GDPyear_election==1962 & country_id==1
replace GDPgrowthratepp=2.810012786 if GDPyear_election==1965 & country_id==1
replace GDPgrowthratepp=5.909495926 if GDPyear_election==1969 & country_id==1
replace GDPgrowthratepp=4.646942731 if GDPyear_election==1971 & country_id==1
replace GDPgrowthratepp=-0.099030082 if GDPyear_election==1975 & country_id==1
replace GDPgrowthratepp=-0.129830488 if GDPyear_election==1978 & country_id==1
replace GDPgrowthratepp=1.938121505 if GDPyear_election==1982 & country_id==1
replace GDPgrowthratepp=2.236402355 if GDPyear_election==1986 & country_id==1
replace GDPgrowthratepp=3.553547647 if GDPyear_election==1990 & country_id==1
replace GDPgrowthratepp=2.008761944 if GDPyear_election==1994 & country_id==1
replace GDPgrowthratepp=2.510912694 if GDPyear_election==1995 & country_id==1
replace GDPgrowthratepp=3.355044661 if GDPyear_election==1999 & country_id==1
replace GDPgrowthratepp=1.152676331 if GDPyear_election==2002 & country_id==1
replace GDPgrowthratepp=2.943417859 if GDPyear_election==2006 & country_id==1
replace GDPgrowthratepp=1.143307119 if GDPyear_election==2008 & country_id==1
replace GDPgrowthratepp=-0.562298943 if GDPyear_election==2013 & country_id==1
replace GDPgrowthratepp=1.550724086 if GDPyear_election==2017 & country_id==1
replace GDPgrowthratepp=1.04090812 if GDPyear_election==2019 & country_id==1

replace GDPgrowthratepp=4.666667 if GDPyear_election==1948 & country_id==2
replace GDPgrowthratepp=0 if GDPyear_election==1949 & country_id==2
replace GDPgrowthratepp=2.744176 if GDPyear_election==1953 & country_id==2
replace GDPgrowthratepp=1.204443 if GDPyear_election==1957 & country_id==2
replace GDPgrowthratepp=5.540729 if GDPyear_election==1960 & country_id==2
replace GDPgrowthratepp=5.949139356 if GDPyear_election==1964 & country_id==2
replace GDPgrowthratepp=3.291575742 if GDPyear_election==1967 & country_id==2
replace GDPgrowthratepp=3.79648857 if GDPyear_election==1971 & country_id==2
replace GDPgrowthratepp=6.047488699 if GDPyear_election==1973 & country_id==2
replace GDPgrowthratepp=5.464140019 if GDPyear_election==1976 & country_id==2
replace GDPgrowthratepp=2.74598979 if GDPyear_election==1978 & country_id==2
replace GDPgrowthratepp=-0.276653455 if GDPyear_election==1981 & country_id==2
replace GDPgrowthratepp=1.621518975 if GDPyear_election==1985 & country_id==2
replace GDPgrowthratepp=2.219478116 if GDPyear_election==1987 & country_id==2
replace GDPgrowthratepp=1.455371726 if GDPyear_election==1991 & country_id==2
replace GDPgrowthratepp=2.909318769 if GDPyear_election==1994 & country_id==2
replace GDPgrowthratepp=1.744323895 if GDPyear_election==1998 & country_id==2
replace GDPgrowthratepp=1.251984606 if GDPyear_election==2002 & country_id==2
replace GDPgrowthratepp=1.8781832 if GDPyear_election==2006 & country_id==2
replace GDPgrowthratepp=-2.80592074 if GDPyear_election==2009 & country_id==2
replace GDPgrowthratepp=-0.013148386 if GDPyear_election==2013 & country_id==2
replace GDPgrowthratepp=1.356791445 if GDPyear_election==2018 & country_id==2

replace GDPgrowthratepp=4.465986 if GDPyear_election==1947 & country_id==3
replace GDPgrowthratepp=6.914074 if GDPyear_election==1950 & country_id==3
replace GDPgrowthratepp=1.508743 if GDPyear_election==1952 & country_id==3
replace GDPgrowthratepp=5.352009 if GDPyear_election==1953 & country_id==3
replace GDPgrowthratepp=1.385209 if GDPyear_election==1956 & country_id==3
replace GDPgrowthratepp=5.199186 if GDPyear_election==1960 & country_id==3
replace GDPgrowthratepp=8.400119265 if GDPyear_election==1964 & country_id==3
replace GDPgrowthratepp=1.919198017 if GDPyear_election==1966 & country_id==3
replace GDPgrowthratepp=4.70161895 if GDPyear_election==1967 & country_id==3
replace GDPgrowthratepp=2.291699419 if GDPyear_election==1971 & country_id==3
replace GDPgrowthratepp=3.465614309 if GDPyear_election==1973 & country_id==3
replace GDPgrowthratepp=-1.581692398 if GDPyear_election==1974 & country_id==3
replace GDPgrowthratepp=5.658698172 if GDPyear_election==1976 & country_id==3
replace GDPgrowthratepp=3.614290364 if GDPyear_election==1979 & country_id==3
replace GDPgrowthratepp=-0.63790415 if GDPyear_election==1981 & country_id==3
replace GDPgrowthratepp=2.666544948 if GDPyear_election==1983 & country_id==3
replace GDPgrowthratepp=0.127360299 if GDPyear_election==1987 & country_id==3
replace GDPgrowthratepp=1.310525163 if GDPyear_election==1990 & country_id==3
replace GDPgrowthratepp=4.977347179 if GDPyear_election==1994 & country_id==3
replace GDPgrowthratepp=2.832664465 if GDPyear_election==1997 & country_id==3
replace GDPgrowthratepp=0.462534295 if GDPyear_election==2001 & country_id==3
replace GDPgrowthratepp=2.403233997 if GDPyear_election==2004 & country_id==3
replace GDPgrowthratepp=0.462731494 if GDPyear_election==2007 & country_id==3
replace GDPgrowthratepp=0.920393685 if GDPyear_election==2011 & country_id==3
replace GDPgrowthratepp=1.105433466 if GDPyear_election==2014 & country_id==3
replace GDPgrowthratepp=1.485085157 if GDPyear_election==2018 & country_id==3

replace GDPgrowthratepp=6.847965181 if GDPyear_election==1961 & country_id==4
replace GDPgrowthratepp=4.952389127 if GDPyear_election==1965 & country_id==4
replace GDPgrowthratepp=9.656904148 if GDPyear_election==1969 & country_id==4
replace GDPgrowthratepp=2.227824609 if GDPyear_election==1971 & country_id==4
replace GDPgrowthratepp=1.354025294 if GDPyear_election==1975 & country_id==4
replace GDPgrowthratepp=2.624625735 if GDPyear_election==1978 & country_id==4
replace GDPgrowthratepp=2.532004036 if GDPyear_election==1982 & country_id==4
replace GDPgrowthratepp=2.422429813 if GDPyear_election==1986 & country_id==4
replace GDPgrowthratepp=0.224909953 if GDPyear_election==1990 & country_id==4
replace GDPgrowthratepp=3.515885274 if GDPyear_election==1994 & country_id==4
replace GDPgrowthratepp=5.17759148 if GDPyear_election==1998 & country_id==4
replace GDPgrowthratepp=1.460928622 if GDPyear_election==2002 & country_id==4
replace GDPgrowthratepp=3.628941348 if GDPyear_election==2006 & country_id==4
replace GDPgrowthratepp=2.714966735 if GDPyear_election==2010 & country_id==4
replace GDPgrowthratepp=-0.776108383 if GDPyear_election==2014 & country_id==4
replace GDPgrowthratepp=1.00788071 if GDPyear_election==2018 & country_id==4

replace GDPgrowthratepp=5.361746593 if GDPyear_election==1962 & country_id==5
replace GDPgrowthratepp=4.180609921 if GDPyear_election==1966 & country_id==5
replace GDPgrowthratepp=4.000543404 if GDPyear_election==1967 & country_id==5
replace GDPgrowthratepp=3.676300973 if GDPyear_election==1972 & country_id==5
replace GDPgrowthratepp=2.993838261 if GDPyear_election==1977 & country_id==5
replace GDPgrowthratepp=1.128687868 if GDPyear_election==1980 & country_id==5
replace GDPgrowthratepp=1.054121301 if GDPyear_election==1985 & country_id==5
replace GDPgrowthratepp=1.9774927 if GDPyear_election==1987 & country_id==5
replace GDPgrowthratepp=1.095401359 if GDPyear_election==1992 & country_id==5
replace GDPgrowthratepp=1.054560163 if GDPyear_election==1996 & country_id==5
replace GDPgrowthratepp=1.24418882 if GDPyear_election==2001 & country_id==5
replace GDPgrowthratepp=1.737540033 if GDPyear_election==2006 & country_id==5
replace GDPgrowthratepp=1.699612965 if GDPyear_election==2011 & country_id==5
replace GDPgrowthratepp=0.829056665 if GDPyear_election==2016 & country_id==5

replace GDPgrowthratepp=7.731166 if GDPyear_election==1953 & country_id==6
replace GDPgrowthratepp=5.377073 if GDPyear_election==1957 & country_id==6
replace GDPgrowthratepp=4.127686 if GDPyear_election==1961 & country_id==6
replace GDPgrowthratepp=4.996021 if GDPyear_election==1965 & country_id==6
replace GDPgrowthratepp=6.771467 if GDPyear_election==1969 & country_id==6
replace GDPgrowthratepp=3.802476016 if GDPyear_election==1972 & country_id==6
replace GDPgrowthratepp=5.400212111 if GDPyear_election==1976 & country_id==6
replace GDPgrowthratepp=1.198693908 if GDPyear_election==1980 & country_id==6
replace GDPgrowthratepp=-0.300057816 if GDPyear_election==1982 & country_id==6
replace GDPgrowthratepp=2.240534998 if GDPyear_election==1986 & country_id==6
replace GDPgrowthratepp=4.351639054 if GDPyear_election==1990 & country_id==6
replace GDPgrowthratepp=2.03735421 if GDPyear_election==1994 & country_id==6
replace GDPgrowthratepp=1.998485321 if GDPyear_election==1998 & country_id==6
replace GDPgrowthratepp=-0.365628327 if GDPyear_election==2002 & country_id==6
replace GDPgrowthratepp=0.788917116 if GDPyear_election==2005 & country_id==6
replace GDPgrowthratepp=-5.454577169 if GDPyear_election==2009 & country_id==6
replace GDPgrowthratepp=0.163870563 if GDPyear_election==2013 & country_id==6
replace GDPgrowthratepp=2.297206047 if GDPyear_election==2017 & country_id==6

replace GDPgrowthratepp=-2.432460774 if GDPyear_election==1981 & country_id==7
replace GDPgrowthratepp=1.503672107 if GDPyear_election==1984 & country_id==7
replace GDPgrowthratepp=3.909776905 if GDPyear_election==1988 & country_id==7
replace GDPgrowthratepp=3.259729674 if GDPyear_election==1989 & country_id==7
replace GDPgrowthratepp=-2.177150486 if GDPyear_election==1993 & country_id==7
replace GDPgrowthratepp=2.4098431 if GDPyear_election==1996 & country_id==7
replace GDPgrowthratepp=2.678099384 if GDPyear_election==1999 & country_id==7
replace GDPgrowthratepp=5.542360362 if GDPyear_election==2003 & country_id==7
replace GDPgrowthratepp=3.010984078 if GDPyear_election==2007 & country_id==7
replace GDPgrowthratepp=-4.552117048 if GDPyear_election==2009 & country_id==7
replace GDPgrowthratepp=-10.01628121 if GDPyear_election==2011 & country_id==7
replace GDPgrowthratepp=1.147211957 if GDPyear_election==2014 & country_id==7
replace GDPgrowthratepp=0.463652786 if GDPyear_election==2015 & country_id==7
replace GDPgrowthratepp=1.910891048 if GDPyear_election==2019 & country_id==7

replace GDPgrowthratepp=-3.532528 if GDPyear_election==1952 & country_id==8
replace GDPgrowthratepp=8.411267 if GDPyear_election==1955 & country_id==8
replace GDPgrowthratepp=6.771791 if GDPyear_election==1958 & country_id==8
replace GDPgrowthratepp=.734934 if GDPyear_election==1959 & country_id==8
replace GDPgrowthratepp=6.324752321 if GDPyear_election==1962 & country_id==8
replace GDPgrowthratepp=6.910046042 if GDPyear_election==1966 & country_id==8
replace GDPgrowthratepp=12 if GDPyear_election==1970 & country_id==8
replace GDPgrowthratepp=5.3 if GDPyear_election==1973 & country_id==8
replace GDPgrowthratepp=8 if GDPyear_election==1977 & country_id==8
replace GDPgrowthratepp=3.9 if GDPyear_election==1979 & country_id==8
replace GDPgrowthratepp=0.8 if GDPyear_election==1982 & country_id==8
replace GDPgrowthratepp=5.5 if GDPyear_election==1986 & country_id==8
replace GDPgrowthratepp=0.4 if GDPyear_election==1990 & country_id==8
replace GDPgrowthratepp=2.7 if GDPyear_election==1994 & country_id==8
replace GDPgrowthratepp=6.219220123 if GDPyear_election==1998 & country_id==8
replace GDPgrowthratepp=-0.334077504 if GDPyear_election==2002 & country_id==8
replace GDPgrowthratepp=3.850348692 if GDPyear_election==2006 & country_id==8
replace GDPgrowthratepp=0.3264001 if GDPyear_election==2008 & country_id==8
replace GDPgrowthratepp=0.527304433 if GDPyear_election==2012 & country_id==8
replace GDPgrowthratepp=4.838299214 if GDPyear_election==2016 & country_id==8
replace GDPgrowthratepp=1.779410135 if GDPyear_election==2017 & country_id==8

replace GDPgrowthratepp=1.310616 if GDPyear_election==1947 & country_id==9
replace GDPgrowthratepp=1.439483 if GDPyear_election==1950 & country_id==9
replace GDPgrowthratepp=3.860277 if GDPyear_election==1953 & country_id==9
replace GDPgrowthratepp=-2.729366 if GDPyear_election==1956 & country_id==9
replace GDPgrowthratepp=5.491478 if GDPyear_election==1961 & country_id==9
replace GDPgrowthratepp=3.86331 if GDPyear_election==1964 & country_id==9
replace GDPgrowthratepp=8.632327 if GDPyear_election==1968 & country_id==9
replace GDPgrowthratepp=4.918859 if GDPyear_election==1972 & country_id==9
replace GDPgrowthratepp=-0.12389908 if GDPyear_election==1976 & country_id==9
replace GDPgrowthratepp=1.899872486 if GDPyear_election==1980 & country_id==9
replace GDPgrowthratepp=2.122299159 if GDPyear_election==1981 & country_id==9
replace GDPgrowthratepp=1.321020581 if GDPyear_election==1982 & country_id==9
replace GDPgrowthratepp=-0.473563622 if GDPyear_election==1986 & country_id==9
replace GDPgrowthratepp=5.668378039 if GDPyear_election==1988 & country_id==9
replace GDPgrowthratepp=2.640607465 if GDPyear_election==1992 & country_id==9
replace GDPgrowthratepp=6.526964461 if GDPyear_election==1996 & country_id==9
replace GDPgrowthratepp=3.641153981 if GDPyear_election==2001 & country_id==9
replace GDPgrowthratepp=2.188033451 if GDPyear_election==2006 & country_id==9
replace GDPgrowthratepp=1.202141007 if GDPyear_election==2010 & country_id==9
replace GDPgrowthratepp=23.9990932 if GDPyear_election==2015 & country_id==9
replace GDPgrowthratepp=3.491900991 if GDPyear_election==2019 & country_id==9

replace GDPgrowthratepp=5.48747777 if GDPyear_election==1962 & country_id==10
replace GDPgrowthratepp=6.405677604 if GDPyear_election==1967 & country_id==10
replace GDPgrowthratepp=1.344280395 if GDPyear_election==1971 & country_id==10
replace GDPgrowthratepp=-2.673183923 if GDPyear_election==1975 & country_id==10
replace GDPgrowthratepp=2.872936349 if GDPyear_election==1978 & country_id==10
replace GDPgrowthratepp=0.33922499 if GDPyear_election==1982 & country_id==10
replace GDPgrowthratepp=2.854366887 if GDPyear_election==1986 & country_id==10
replace GDPgrowthratepp=1.468175611 if GDPyear_election==1991 & country_id==10
replace GDPgrowthratepp=-0.913401722 if GDPyear_election==1993 & country_id==10
replace GDPgrowthratepp=2.885202351 if GDPyear_election==1995 & country_id==10
replace GDPgrowthratepp=3.739946533 if GDPyear_election==2000 & country_id==10
replace GDPgrowthratepp=0.323656244 if GDPyear_election==2005 & country_id==10
replace GDPgrowthratepp=0.975922133 if GDPyear_election==2007 & country_id==10
replace GDPgrowthratepp=-3.24206012 if GDPyear_election==2012 & country_id==10
replace GDPgrowthratepp=1.820333852 if GDPyear_election==2017 & country_id==10

replace GDPgrowthratepp=8.755943 if GDPyear_election==1948 & country_id==12
replace GDPgrowthratepp=.9547323 if GDPyear_election==1951 & country_id==12
replace GDPgrowthratepp=6.287582 if GDPyear_election==1955 & country_id==12
replace GDPgrowthratepp=-2.412522 if GDPyear_election==1958 & country_id==12
replace GDPgrowthratepp=5.332336874 if GDPyear_election==1962 & country_id==12
replace GDPgrowthratepp=1.408870388 if GDPyear_election==1966 & country_id==12
replace GDPgrowthratepp=4.833288749 if GDPyear_election==1970 & country_id==12
replace GDPgrowthratepp=2.492243202 if GDPyear_election==1972 & country_id==12
replace GDPgrowthratepp=3.639544497 if GDPyear_election==1976 & country_id==12
replace GDPgrowthratepp=0.543128027 if GDPyear_election==1980 & country_id==12
replace GDPgrowthratepp=-1.69259009 if GDPyear_election==1982 & country_id==12
replace GDPgrowthratepp=2.102934813 if GDPyear_election==1985 & country_id==12
replace GDPgrowthratepp=3.795569306 if GDPyear_election==1989 & country_id==12
replace GDPgrowthratepp=0.554249624 if GDPyear_election==1993 & country_id==12
replace GDPgrowthratepp=3.793381777 if GDPyear_election==1997 & country_id==12
replace GDPgrowthratepp=1.557458129 if GDPyear_election==2001 & country_id==12
replace GDPgrowthratepp=-0.42036774 if GDPyear_election==2002 & country_id==12
replace GDPgrowthratepp=3.29494984 if GDPyear_election==2006 & country_id==12
replace GDPgrowthratepp=-4.161038495 if GDPyear_election==2009 & country_id==12
replace GDPgrowthratepp=-1.395919336 if GDPyear_election==2012 & country_id==12
replace GDPgrowthratepp=1.649315547 if GDPyear_election==2016 & country_id==12
replace GDPgrowthratepp=-4.329611883 if GDPyear_election==2020 & country_id==12

replace GDPgrowthratepp=.9262833 if GDPyear_election==1949 & country_id==13
replace GDPgrowthratepp=3.597865 if GDPyear_election==1953 & country_id==13
replace GDPgrowthratepp=3.149542 if GDPyear_election==1957 & country_id==13
replace GDPgrowthratepp=5.432493155 if GDPyear_election==1961 & country_id==13
replace GDPgrowthratepp=4.470367905 if GDPyear_election==1965 & country_id==13
replace GDPgrowthratepp=3.656641879 if GDPyear_election==1969 & country_id==13
replace GDPgrowthratepp=3.804257512 if GDPyear_election==1973 & country_id==13
replace GDPgrowthratepp=3.721429201 if GDPyear_election==1977 & country_id==13
replace GDPgrowthratepp=1.249296097 if GDPyear_election==1981 & country_id==13
replace GDPgrowthratepp=5.237729582 if GDPyear_election==1985 & country_id==13
replace GDPgrowthratepp=0.622056009 if GDPyear_election==1989 & country_id==13
replace GDPgrowthratepp=2.234977116 if GDPyear_election==1993 & country_id==13
replace GDPgrowthratepp=4.715263835 if GDPyear_election==1997 & country_id==13
replace GDPgrowthratepp=1.559548852 if GDPyear_election==2001 & country_id==13
replace GDPgrowthratepp=1.928840748 if GDPyear_election==2005 & country_id==13
replace GDPgrowthratepp=-2.958585549 if GDPyear_election==2009 & country_id==13
replace GDPgrowthratepp=-0.180216051 if GDPyear_election==2013 & country_id==13
replace GDPgrowthratepp=1.50014938 if GDPyear_election==2017 & country_id==13

replace GDPgrowthratepp=4.512543383 if GDPyear_election==1979 & country_id==14
replace GDPgrowthratepp=3.464371113 if GDPyear_election==1980 & country_id==14
replace GDPgrowthratepp=1.512893397 if GDPyear_election==1982 & country_id==14
replace GDPgrowthratepp=2.526604936 if GDPyear_election==1985 & country_id==14
replace GDPgrowthratepp=6.41006293 if GDPyear_election==1987 & country_id==14
replace GDPgrowthratepp=4.609033561 if GDPyear_election==1991 & country_id==14
replace GDPgrowthratepp=3.922373598 if GDPyear_election==1995 & country_id==14
replace GDPgrowthratepp=3.320509259 if GDPyear_election==1999 & country_id==14
replace GDPgrowthratepp=1.227263423 if GDPyear_election==2001 & country_id==14
replace GDPgrowthratepp=1.545620102 if GDPyear_election==2004 & country_id==14
replace GDPgrowthratepp=-3.214389967 if GDPyear_election==2009 & country_id==14
replace GDPgrowthratepp=1.690928415 if GDPyear_election==2010 & country_id==14
replace GDPgrowthratepp=2.214482885 if GDPyear_election==2015 & country_id==14
replace GDPgrowthratepp=2.658392606 if GDPyear_election==2019 & country_id==14

replace GDPgrowthratepp=0.490728395 if GDPyear_election==1978 & country_id==15
replace GDPgrowthratepp=0.640409096 if GDPyear_election==1982 & country_id==15
replace GDPgrowthratepp=1.951329084 if GDPyear_election==1985 & country_id==15
replace GDPgrowthratepp=4.662815239 if GDPyear_election==1989 & country_id==15
replace GDPgrowthratepp=0.436115221 if GDPyear_election==1992 & country_id==15
replace GDPgrowthratepp=2.304957017 if GDPyear_election==1995 & country_id==15
replace GDPgrowthratepp=4.067824456 if GDPyear_election==1999 & country_id==15
replace GDPgrowthratepp=1.136253252 if GDPyear_election==2003 & country_id==15
replace GDPgrowthratepp=1.704522023 if GDPyear_election==2007 & country_id==15
replace GDPgrowthratepp=-1.166192626 if GDPyear_election==2011 & country_id==15
replace GDPgrowthratepp=3.915768451 if GDPyear_election==2015 & country_id==15
replace GDPgrowthratepp=1.841757858 if GDPyear_election==2018 & country_id==15

replace GDPgrowthratepp=1.894737 if GDPyear_election==1948 & country_id==16
replace GDPgrowthratepp=.8288727 if GDPyear_election==1952 & country_id==16
replace GDPgrowthratepp=2.611532 if GDPyear_election==1956 & country_id==16
replace GDPgrowthratepp=1.671829 if GDPyear_election==1958 & country_id==16
replace GDPgrowthratepp=3.259827 if GDPyear_election==1960 & country_id==16
replace GDPgrowthratepp=6.026059128 if GDPyear_election==1964 & country_id==16
replace GDPgrowthratepp=3.057694231 if GDPyear_election==1968 & country_id==16
replace GDPgrowthratepp=6.292337745 if GDPyear_election==1970 & country_id==16
replace GDPgrowthratepp=3.788932053 if GDPyear_election==1973 & country_id==16
replace GDPgrowthratepp=0.691238123 if GDPyear_election==1976 & country_id==16
replace GDPgrowthratepp=3.613647519 if GDPyear_election==1979 & country_id==16
replace GDPgrowthratepp=1.19077538 if GDPyear_election==1982 & country_id==16
replace GDPgrowthratepp=1.991774101 if GDPyear_election==1985 & country_id==16
replace GDPgrowthratepp=2.088760519 if GDPyear_election==1988 & country_id==16
replace GDPgrowthratepp=-1.817515173 if GDPyear_election==1991 & country_id==16
replace GDPgrowthratepp=3.1939554 if GDPyear_election==1994 & country_id==16
replace GDPgrowthratepp=4.253946709 if GDPyear_election==1998 & country_id==16
replace GDPgrowthratepp=1.864873974 if GDPyear_election==2002 & country_id==16
replace GDPgrowthratepp=4.075714897 if GDPyear_election==2006 & country_id==16
replace GDPgrowthratepp=5.052678573 if GDPyear_election==2010 & country_id==16
replace GDPgrowthratepp=1.644244006 if GDPyear_election==2014 & country_id==16
replace GDPgrowthratepp=0.772577449 if GDPyear_election==2018 & country_id==16

replace GDPgrowthratepp=3.112956 if GDPyear_election==1949 & country_id==17
replace GDPgrowthratepp=2.651679 if GDPyear_election==1951 & country_id==17
replace GDPgrowthratepp=2.623397 if GDPyear_election==1954 & country_id==17
replace GDPgrowthratepp=2.547925 if GDPyear_election==1959 & country_id==17
replace GDPgrowthratepp=4.849644927 if GDPyear_election==1964 & country_id==17
replace GDPgrowthratepp=1.488048483 if GDPyear_election==1965 & country_id==17
replace GDPgrowthratepp=1.501172983 if GDPyear_election==1969 & country_id==17
replace GDPgrowthratepp=6.318244977 if GDPyear_election==1973 & country_id==17
replace GDPgrowthratepp=-2.545877184 if GDPyear_election==1974 & country_id==17
replace GDPgrowthratepp=4.198675446 if GDPyear_election==1978 & country_id==17
replace GDPgrowthratepp=2.031455683 if GDPyear_election==1982 & country_id==17
replace GDPgrowthratepp=2.911710255 if GDPyear_election==1986 & country_id==17
replace GDPgrowthratepp=-1.408485804 if GDPyear_election==1991 & country_id==17
replace GDPgrowthratepp=2.168064564 if GDPyear_election==1996 & country_id==17
replace GDPgrowthratepp=3.302607784 if GDPyear_election==2000 & country_id==17
replace GDPgrowthratepp=1.774937925 if GDPyear_election==2004 & country_id==17
replace GDPgrowthratepp=-4.96888827 if GDPyear_election==2009 & country_id==17
replace GDPgrowthratepp=2.235458153 if GDPyear_election==2014 & country_id==17
replace GDPgrowthratepp=1.491364299 if GDPyear_election==2016 & country_id==17
replace GDPgrowthratepp=1.099995912 if GDPyear_election==2019 & country_id==17


** PARTY'S VOTE SHARE, NEXT ELECTION **

gen voteshare_nextelection=.

* AUSTRIA * 

replace voteshare_nextelection=38.71 if next_election==-3736 & elecdate==-5150 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=44.03 if next_election==-3736 & elecdate==-5150 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=42.11 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=41.26 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=45.96 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelection=43.05 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=44.19 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelection=44.79 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=44 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=45.43 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=42.56 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=48.35 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=44.69 if next_election==3712 & elecdate==2256 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=50.04 if next_election==4300 & elecdate==3712 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=50.42 if next_election==5756 & elecdate==4300 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=51.03 if next_election==7065 & elecdate==5756 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=47.65 if next_election==8514 & elecdate==7065 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=9.73 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelection=43.12 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=42.78 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=32.06 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=27.67 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelection=34.92 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=38.06 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=28.29 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=26.91 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelection=33.2 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelection=42.3 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelection=10.01 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="FPÖ"

replace voteshare_nextelection=11.04 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelection=34.33 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=25.98 if next_election==17803 & elecdate==17075 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=26.82 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=23.99 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=26.86 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelection=31.47 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelection=16.17 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelection=37.46 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="ÖVP"


* BELGIUM * 
replace voteshare_nextelection=43.55 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelection=15.25 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelection=29.75 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelection=47.68 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelection=11.61 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelection=41.15 if next_election==-2091 & elecdate==-3498 & country_id==2 & partyname=="CVP-PSC"

replace voteshare_nextelection=11.47 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelection=37.47 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelection=41.46 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelection=12.33 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelection=34.45 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelection=28.28 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelection=11.71 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelection=20.88 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelection=27.99 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelection=19.67 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=10.38 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=27.24 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelection=23.25 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=9.09 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=5.6 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=26.66 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="PSB-BSP"
replace voteshare_nextelection=9.6 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=26.19 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=9.75 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=5.89 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=2.96 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="RW"
replace voteshare_nextelection=8.54 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=26.13 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=10.13 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=4.25 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="FDF"
replace voteshare_nextelection=12.37+13.01 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="PSB-BSP"
replace voteshare_nextelection=7.02 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="VU"

replace voteshare_nextelection=19.34 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=7.15 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=2.5 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="FDF"
replace voteshare_nextelection=8.57 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=12.7 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=12.36 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="SP"
replace voteshare_nextelection=12.89 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=21.29 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=7.95 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=10.21 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=10.75 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=19.45 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=8.01 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=9.41 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=11.55 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=16.82 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=7.74 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=13.49 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=11.98 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="SP"
replace voteshare_nextelection=5.89 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="VU"

replace voteshare_nextelection=17.18 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=7.73 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=11.87 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=12.56 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="SP"

replace voteshare_nextelection=14.09 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=5.88 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=10.16 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=9.55 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="SP"

replace voteshare_nextelection=3.06 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="E"
replace voteshare_nextelection=2.47 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="G"
replace voteshare_nextelection=11.4 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=13.02 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=14.91 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="SP"
replace voteshare_nextelection=15.36 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=12.52 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=10.86 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=10.26 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="SP"
replace voteshare_nextelection=11.83 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=10.85 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=5.52 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=9.28 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=13.7 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=8.64 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=11.61 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=11.61 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CdH"
replace voteshare_nextelection=9.64 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=11.67 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="PS"
replace voteshare_nextelection=8.83 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="SP"16.
replace voteshare_nextelection=9.63 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="VLD"

replace voteshare_nextelection=8.89 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="CDV"
replace voteshare_nextelection=7.56 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="MR"
replace voteshare_nextelection=16.03 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="N-VA"
replace voteshare_nextelection=8.54 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="VLD"



** DENMARK **

replace voteshare_nextelection=27.58 if next_election==-4448 & elecdate==-5176 & country_id==3 & partyname=="V"

replace voteshare_nextelection=39.59 if next_election==-3405 & elecdate==-4448 & country_id==3 & partyname=="S"

replace voteshare_nextelection=17.31 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=40.39 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="S"
replace voteshare_nextelection=22.06 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="V"

replace voteshare_nextelection=16.85 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=23.06 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="V"

replace voteshare_nextelection=39.4 if next_election==-962 & elecdate==-2292 & country_id==3 & partyname=="S"

replace voteshare_nextelection=2.15 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RF"
replace voteshare_nextelection=5.8 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=42.1 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="S"

replace voteshare_nextelection=5.31 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=41.94 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="S"

replace voteshare_nextelection=38.26 if next_election==2517 & elecdate==1726 & country_id==3 & partyname=="S"

replace voteshare_nextelection=34.15 if next_election==2944 & elecdate==2517 & country_id==3 & partyname=="S"

replace voteshare_nextelection=16.69 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=14.34 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=15.63 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="V"

replace voteshare_nextelection=25.65 if next_election==5086 & elecdate==4281 & country_id==3 & partyname=="S"

replace voteshare_nextelection=23.32 if next_election==5487 & elecdate==5086 & country_id==3 & partyname=="V"

replace voteshare_nextelection=37.03 if next_election==6255 & elecdate==5487 & country_id==3 & partyname=="S"

replace voteshare_nextelection=38.27 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="S" 
replace voteshare_nextelection=12.5 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="V" 

replace voteshare_nextelection=32.87 if next_election==8012 & elecdate==7235 & country_id==3 & partyname=="S"

replace voteshare_nextelection=4.6 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="CD"
replace voteshare_nextelection=23.45 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=2.73 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KrF"
replace voteshare_nextelection=31.61 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="S"
replace voteshare_nextelection=12.07 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="V"

replace voteshare_nextelection=4.79 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="CD"
replace voteshare_nextelection=20.84 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=2.37 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KrF"
replace voteshare_nextelection=10.54 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="V"

replace voteshare_nextelection=4.67 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="CD"
replace voteshare_nextelection=19.29 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=2.04 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KrF"
replace voteshare_nextelection=11.84 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="V"

replace voteshare_nextelection=15.97 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="KF" 
replace voteshare_nextelection=3.55 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="RV" 
replace voteshare_nextelection=15.79 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="V" 

replace voteshare_nextelection=2.84 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="CD"
replace voteshare_nextelection=15.02 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=1.85 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KrF"
replace voteshare_nextelection=4.59 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=34.56 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="S"
replace voteshare_nextelection=23.3 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="V"

replace voteshare_nextelection=4.31 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="CD"
replace voteshare_nextelection=3.85 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=35.93 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="S"

replace voteshare_nextelection=5.19 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=29.08 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="S"

replace voteshare_nextelection=10.27 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=29.03 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="V"

replace voteshare_nextelection=10.39 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=26.26 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="V"

replace voteshare_nextelection=4.92 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=26.74 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="V"

replace voteshare_nextelection=4.58 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="RV"
replace voteshare_nextelection=26.28 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="S"
replace voteshare_nextelection=4.19 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="SF"

replace voteshare_nextelection=6.62 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="KF"
replace voteshare_nextelection=2.33 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="LA"
replace voteshare_nextelection=23.39 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="V"


* FINLAND * 

replace voteshare_nextelection=24.24 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=7.74 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=26.32 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=19.99 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelection=23.26 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=5.68 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=7.57 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=26.52 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="SDP"

replace voteshare_nextelection=24.1 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=6.98 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=26.25 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="SDP"

replace voteshare_nextelection=23.06 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="KESK" 
replace voteshare_nextelection=5.89 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="LKP" 
replace voteshare_nextelection=6.73 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="RKP" 
replace voteshare_nextelection=23.16 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="SDP" 
replace voteshare_nextelection=1.75 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="TPSL" 

replace voteshare_nextelection=22.95 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=14.65 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=5.95 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=6.41 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=19.5 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="SDP"

replace voteshare_nextelection=21.23 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=13.79 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=6.47 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=5.98 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=2.58 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="TPSL"

replace voteshare_nextelection=17.12 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=5.7 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=23.43 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=16.59 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelection=16.41 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=5.16 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=5.36 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=25.79 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=17.02 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelection=17.63 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=4.35 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=5.01 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=24.86 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="SDP"

replace voteshare_nextelection=17.29 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=3.68 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="LKP"
replace voteshare_nextelection=4.55 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=23.89 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=17.9 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelection=17.63 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=4.93 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=26.71 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=13.97 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelection=17.62 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=5.62 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=24.14 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=6.32 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SMP"

replace voteshare_nextelection=19.31 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=5.83 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=22.12 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=4.85 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SMP"

replace voteshare_nextelection=19.85 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=17.89 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=5.49 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=2.96 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="SKL"

replace voteshare_nextelection=21.03 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=5.51 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=22.86 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=10.08 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelection=7.27 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelection=18.55 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=4.61 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=24.47 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=9.93 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelection=8.01 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelection=23.11 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=4.97 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=21.44 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="SDP"

replace voteshare_nextelection=15.76 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=20.38 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=4.38 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=7.25 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelection=18.2 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=4.88 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="RKP"
replace voteshare_nextelection=16.51 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SDP"
replace voteshare_nextelection=7.13 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelection=3.54 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKL"
replace voteshare_nextelection=8.53 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelection=13.76 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KESK"
replace voteshare_nextelection=17 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KOK"
replace voteshare_nextelection=17.48 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="SMP"


* GERMANY * 

replace voteshare_nextelection=45.17 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=3.25 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="DP"
replace voteshare_nextelection=9.54 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=50.19 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="CDU-CSU" 
replace voteshare_nextelection=3.37 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="DP" 
replace voteshare_nextelection=7.71 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="FDP" 
replace voteshare_nextelection=5.87 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="GB-BHE" 

replace voteshare_nextelection=45.32 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="CDU-CSU"

replace voteshare_nextelection=47.59 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=9.49 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=46.09 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=7.92 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="FDP"
replace voteshare_nextelection=42.56 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=8.36 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="FDP"
replace voteshare_nextelection=45.85 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=7.92 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="FDP"
replace voteshare_nextelection=42.56 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=10.62 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="FDP"
replace voteshare_nextelection=42.86 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=48.79 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=6.95 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="FDP"
replace voteshare_nextelection=38.18 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=44.26 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=9.11 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=43.82 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=11.03 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=41.44 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=6.92 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=35.15 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=6.25 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=8.56 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="GR"
replace voteshare_nextelection=38.52 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=8.12 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="GR"
replace voteshare_nextelection=34.25 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=33.8 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=23.04 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=41.5 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=4.8 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="FDP"

replace voteshare_nextelection=32.92 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=20.51 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="SPD"

replace voteshare_nextelection=24.1 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelection=25.7 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="SPD"


* GREECE * 

replace voteshare_nextelection=35.88 if next_election==7961 & elecdate==6533 & country_id==7 & partyname=="ND"

replace voteshare_nextelection=45.82 if next_election==9284 & elecdate==7961 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=39.13 if next_election==10761 & elecdate==9284 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=46.19 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="ND"
replace voteshare_nextelection=10.97 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="SYN"

replace voteshare_nextelection=39.3 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="ND"
replace voteshare_nextelection=38.61 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="PASOK"
replace voteshare_nextelection=10.28 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="SYN"

replace voteshare_nextelection=39.3 if next_election==12336 & elecdate==11055 & country_id==7 & partyname=="ND"

replace voteshare_nextelection=41.49 if next_election==13414 & elecdate==12336 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=43.79 if next_election==14709 & elecdate==13414 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=40.55 if next_election==16137 & elecdate==14709 & country_id==7 & partyname=="PASOK"    
     
replace voteshare_nextelection=41.84 if next_election==17425 & elecdate==16137 & country_id==7 & partyname=="ND"

replace voteshare_nextelection=33.48 if next_election==18174 & elecdate==17425 & country_id==7 & partyname=="ND"

replace voteshare_nextelection=5.63 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="LAOS"
replace voteshare_nextelection=18.85 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="ND"
replace voteshare_nextelection=13.18 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=27.15 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="ND"
replace voteshare_nextelection=4.57 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelection=3.6 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="ANEL"
replace voteshare_nextelection=35.46 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="SYRIZA"
 

* ICELAND * 
 
replace voteshare_nextelection=39.5 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=17.8 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="SDP"
replace voteshare_nextelection=19.5 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="SP"

replace voteshare_nextelection=39.53 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=24.45 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="PP"
replace voteshare_nextelection=16.53 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SDP"
replace voteshare_nextelection=19.49 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SP"

replace voteshare_nextelection=37.12 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=21.91 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=42.37 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=15.63 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=15.25 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PA"
replace voteshare_nextelection=27.2 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PP"
replace voteshare_nextelection=12.54 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=15.17 if next_election==-67 & elecdate==-187 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=41.43 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=14.21 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=37.5 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=15.67 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=36.22 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=10.46 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=18.34 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PA"
replace voteshare_nextelection=24.87 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PP"
replace voteshare_nextelection=4.6 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="ULL"

replace voteshare_nextelection=32.72 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=16.9 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=19.72 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PA"
replace voteshare_nextelection=24.94 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PP"
replace voteshare_nextelection=17.44 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=38.53 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=17.24 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PA"
replace voteshare_nextelection=18.48 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=27.17 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=18.93 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=38.56 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=14.39 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PA"
replace voteshare_nextelection=18.93 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PP"
replace voteshare_nextelection=15.5 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=37.07 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=11.42 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="SDP"

replace voteshare_nextelection=40.74 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=18.35 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=33.69 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=17.73 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=36.64 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=11.72 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=23.7 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=21.68 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="LG"
replace voteshare_nextelection=29.79 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="SDA"

replace voteshare_nextelection=10.87 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="LG"
replace voteshare_nextelection=12.85 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="SDA"

replace voteshare_nextelection=29 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=11.49 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="PP"

replace voteshare_nextelection=1.22 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="BF"
replace voteshare_nextelection=25.25 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=6.69 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="RP"

replace voteshare_nextelection=24.39 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="IP"
replace voteshare_nextelection=12.57 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="LG"
replace voteshare_nextelection=17.27 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="PP"
 
* IRELAND *  
 
replace voteshare_nextelection=41.85 if next_election==-4349 & elecdate==-5694 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=4.07 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnP"
replace voteshare_nextelection=2.92 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnT"
replace voteshare_nextelection=25.75 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=11.4 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=43.36 if next_election==-2054 & elecdate==-3138 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=2.36 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="CnT"
replace voteshare_nextelection=26.62 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=9.11 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=43.83 if next_election==642 & elecdate==-1032 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=47.67 if next_election==1923 & elecdate==642 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=45.66 if next_election==3456 & elecdate==1923 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=46.26 if next_election==4807 & elecdate==3456 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=30.49 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=11.63 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=45.26 if next_election==7832 & elecdate==6376 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=37.3 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=9.12 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=45.2 if next_election==8363 & elecdate==8084 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=27.07 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=6.45 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=44.15 if next_election==10758 & elecdate==9909 & country_id==9 & partyname=="FF"

replace voteshare_nextelection=39.11 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="FF"
replace voteshare_nextelection=4.68 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="PD"

replace voteshare_nextelection=39.33 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FF"
replace voteshare_nextelection=27.95 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=10.4 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="Lab"
replace voteshare_nextelection=2.51 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="WP-DL"

replace voteshare_nextelection=41.48 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="FF"
replace voteshare_nextelection=3.96 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="PD"

replace voteshare_nextelection=41.56 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="FF"
replace voteshare_nextelection=2.73 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="PD"

replace voteshare_nextelection=17.45 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="FF"
replace voteshare_nextelection=1.8 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="GR"

replace voteshare_nextelection=25.52 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="FG"
replace voteshare_nextelection=6.61 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="Lab"

replace voteshare_nextelection=20.9 if next_election==20510+1443 & elecdate==20510 & country_id==9 & partyname=="FG"


* Italy *

replace voteshare_nextelection=48.5 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=22.18 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PCI-PDS-DS"
replace voteshare_nextelection=3.83 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=2.48 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=12.7 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=40.1 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=3.01 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=1.62 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=4.55 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelection=42.35 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=3.54 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=4.55 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelection=38.19 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=1.37 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=6.1 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelection=39.01 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=1.97 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PRI"

replace voteshare_nextelection=38.66 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=2.86 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=5.14 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=9.61 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=38.71 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=1.3 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=3.09 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=3.37 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=9.64 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=38.29 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=3.02 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=3.84 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelection=32.92 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=2.9 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=5.08 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=4.08 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=11.44 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=34.3 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=2.1 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=3.7 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=2.96 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=14.26 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=29.66 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=2.85 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=4.39 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PRI"
replace voteshare_nextelection=2.71 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=13.61 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=. if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="DC"
replace voteshare_nextelection=. if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PLI"
replace voteshare_nextelection=. if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelection=2.18 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSI"

replace voteshare_nextelection=15.67 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="AN"
replace voteshare_nextelection=. if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="CCD-CDU-UDC"
replace voteshare_nextelection=20.57 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelection=10.07 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="LN"

replace voteshare_nextelection=16.56 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PCI-PDS-DS"
replace voteshare_nextelection=1.67 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PdCI"

replace voteshare_nextelection=12.34 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="AN"
replace voteshare_nextelection=6.76 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="CCD-CDU-UDC"
replace voteshare_nextelection=23.71 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelection=4.58 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="LN"
replace voteshare_nextelection=0.75 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="NPSI"

replace voteshare_nextelection=4.36 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="IdV"
replace voteshare_nextelection=33.16 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="PD"
replace voteshare_nextelection=1.4 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="UDR-UDEUR"

replace voteshare_nextelection=21.57 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelection=3.86 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="LN"

replace voteshare_nextelection=13.53 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelection=18.98 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="PD"



* The Netherlands *

replace voteshare_nextelection=31.04 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=25.6 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=8.93 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=28.66 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=28.97 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelection=8.83 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=9.91 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=8.43 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=31.69 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=32.69 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=9.39 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=8.11 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=31.6 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=30.36 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=8.72 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=8.58 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=31.88 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=10.29 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=9.9 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=8.14 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=26.5 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=23.55 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelection=10.73 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=8.59 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=6.32 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=21.84 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=10.34 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=8.84 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="ARP"
replace voteshare_nextelection=4.79 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="CHU"
replace voteshare_nextelection=4.12 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="DS70"
replace voteshare_nextelection=17.66 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="KVP"
replace voteshare_nextelection=14.45 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=5.44 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=1.69 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PPR"
replace voteshare_nextelection=33.83 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=30.81 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=17.32 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=29.39 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=4.26 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=30.39 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=34.59 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=17.41 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=35.31 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=14.57 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=22.22 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=23.97 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=8.99 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=28.98 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelection=24.69 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=5.1 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=15.11 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelection=15.44 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=28.65 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=5.71 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="LPF"
replace voteshare_nextelection=17.95 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=26.51 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=1.96 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=14.67 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=13.62 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=3.25 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CU"
replace voteshare_nextelection=19.63 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelection=8.51 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=26.58 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=5.7 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelection=21.29 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="VVD"

replace voteshare_nextelection=9.5 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CDA"
replace voteshare_nextelection=3.4 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CU"
replace voteshare_nextelection=15 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="D66"
replace voteshare_nextelection=21.9 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="VVD"

* NORWAY *

replace voteshare_nextelection=45.69 if next_election==-3735 & elecdate==-5198 & country_id==13 & partyname=="A"

replace voteshare_nextelection=46.66 if next_election==-2272 & elecdate==-3735 & country_id==13 & partyname=="A"

replace voteshare_nextelection=48.33 if next_election==-816 & elecdate==-2272 & country_id==13 & partyname=="A"

replace voteshare_nextelection=46.76 if next_election==619 & elecdate==-816 & country_id==13 & partyname=="A"

replace voteshare_nextelection=43.14 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="A"
replace voteshare_nextelection=20.99 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="H"
replace voteshare_nextelection=8.13 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=9.79 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="SP"
replace voteshare_nextelection=10.56 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="V"

replace voteshare_nextelection=20.59 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="H"
replace voteshare_nextelection=8.7 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=10.21 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="SP"
replace voteshare_nextelection=9.38 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="V"

replace voteshare_nextelection=35.29 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="A"
replace voteshare_nextelection=19.61 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="H"
replace voteshare_nextelection=13.52 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=8.53 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="SP"
replace voteshare_nextelection=2.47 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="V"

replace voteshare_nextelection=42.26 if next_election==6464 & elecdate==5001 & country_id==13 & partyname=="A"

replace voteshare_nextelection=37.2 if next_election==7927 & elecdate==6464 & country_id==13 & partyname=="A"

replace voteshare_nextelection=30.42 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="H"
replace voteshare_nextelection=8.26 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=6.6 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="SP"

replace voteshare_nextelection=34.27 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="A"
replace voteshare_nextelection=22.23 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="H"
replace voteshare_nextelection=8.49 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=6.47 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="SP"

replace voteshare_nextelection=36.91 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="A"
replace voteshare_nextelection=17.03 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="H"
replace voteshare_nextelection=7.88 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=16.74 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="SP"

replace voteshare_nextelection=35 if next_election==13772 & elecdate==12309 & country_id==13 & partyname=="A"

replace voteshare_nextelection=24.29 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="A"
replace voteshare_nextelection=12.4 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=5.56 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="SP"
replace voteshare_nextelection=3.9 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="V"

replace voteshare_nextelection=14.1 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="H"
replace voteshare_nextelection=6.78 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=5.92 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="V"

replace voteshare_nextelection=35.38 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="A"
replace voteshare_nextelection=6.2 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelection=6.15 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SP"

replace voteshare_nextelection=30.84 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="A"
replace voteshare_nextelection=4.09 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelection=5.48 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SP"

replace voteshare_nextelection=15.19 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="FRP"
replace voteshare_nextelection=25.04 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="H"

replace voteshare_nextelection=11.6 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="FRP"
replace voteshare_nextelection=20.4 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="H"
replace voteshare_nextelection=3.8 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="KRF"
replace voteshare_nextelection=4.6 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="V"
 
* PORTUGAL *
 
replace voteshare_nextelection=15.21 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelection=28.24 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="PS"

replace voteshare_nextelection=16.57 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelection=2.16 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PPM"
replace voteshare_nextelection=29.53 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=12.72 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelection=0.5 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PPM"
replace voteshare_nextelection=27.77 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=21.38 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PS"
replace voteshare_nextelection=30.59 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=51.29 if next_election==10061 & elecdate==9410 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=50.99 if next_election==11601 & elecdate==10061 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=34.78 if next_election==13057 & elecdate==11601 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=44.41 if next_election==14527 & elecdate==13057 & country_id==14 & partyname=="PS"

replace voteshare_nextelection=38.55 if next_election==15416 & elecdate==14527 & country_id==14 & partyname=="PS"

replace voteshare_nextelection=7.46 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelection=29.64 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="PSD"

replace voteshare_nextelection=37.73 if next_election==18167 & elecdate==16487 & country_id==14 & partyname=="PS"

replace voteshare_nextelection=29.24 if next_election==18783 & elecdate==18167 & country_id==14 & partyname=="PS"

replace voteshare_nextelection=4.44 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelection=38.2 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PS"
replace voteshare_nextelection=29.18 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PSD"

* SPAIN
 
replace voteshare_nextelection=35.05 if next_election==6999 & elecdate==6375 & country_id==15 & partyname=="UCD"

replace voteshare_nextelection=6.81 if next_election==8336 & elecdate==6999 & country_id==15 & partyname=="UCD"

replace voteshare_nextelection=44.34 if next_election==9669 & elecdate==8336 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=39.88 if next_election==10894 & elecdate==9669 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=39.1 if next_election==12210 & elecdate==10894 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=37.63 if next_election==13211 & elecdate==12210 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=44.52 if next_election==14681 & elecdate==13211 & country_id==15 & partyname=="PP"

replace voteshare_nextelection=37.71 if next_election==16144 & elecdate==14681 & country_id==15 & partyname=="PP"

replace voteshare_nextelection=44.14 if next_election==17600 & elecdate==16144 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=29.13 if next_election==18951 & elecdate==17600 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelection=28.7 if next_election==20442 & elecdate==18951 & country_id==15 & partyname=="PP"

replace voteshare_nextelection=33.02 if next_election==20631 & elecdate==20442 & country_id==15 & partyname=="PP"

replace voteshare_nextelection=16.83 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PP"
replace voteshare_nextelection=28.9 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PSOE"

** SWEDEN **

replace voteshare_nextelection=46.13 if next_election==-4121 & elecdate==-5584 & country_id==16 & partyname=="S"

replace voteshare_nextelection=10.73 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="C"
replace voteshare_nextelection=46.05 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="S"

replace voteshare_nextelection=9.45 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="C" 
replace voteshare_nextelection=44.58 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="S" 

replace voteshare_nextelection=12.66 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="C"
replace voteshare_nextelection=46.22 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="S"

replace voteshare_nextelection=47.79 if next_election==261 & elecdate==-579 & country_id==16 & partyname=="S"

replace voteshare_nextelection=47.27 if next_election==1724 & elecdate==261 & country_id==16 & partyname=="S"
replace voteshare_nextelection=50.12 if next_election==3180 & elecdate==1724 & country_id==16 & partyname=="S"
replace voteshare_nextelection=45.34 if next_election==3915 & elecdate==3180 & country_id==16 & partyname=="S"
replace voteshare_nextelection=43.56 if next_election==5007 & elecdate==3915 & country_id==16 & partyname=="S"
replace voteshare_nextelection=42.75 if next_election==6106 & elecdate==5007 & country_id==16 & partyname=="S"

replace voteshare_nextelection=18.07 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="C"
replace voteshare_nextelection=10.59 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="L"
replace voteshare_nextelection=20.34 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="M"

replace voteshare_nextelection=15.48 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="C"
replace voteshare_nextelection=5.9 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="L"
replace voteshare_nextelection=23.64 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="M"


replace voteshare_nextelection=44.68 if next_election==9389 & elecdate==8297 & country_id==16 & partyname=="S"
replace voteshare_nextelection=43.21 if next_election==10488 & elecdate==9389 & country_id==16 & partyname=="S"
replace voteshare_nextelection=37.7 if next_election==11580 & elecdate==10488 & country_id==16 & partyname=="S"

replace voteshare_nextelection=7.65 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="C"
replace voteshare_nextelection=4.07 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="KD"
replace voteshare_nextelection=7.19 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="L"
replace voteshare_nextelection=22.38 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="M"

replace voteshare_nextelection=36.39 if next_election==14142 & elecdate==12679 & country_id==16 & partyname=="S"
replace voteshare_nextelection=39.85 if next_election==15598 & elecdate==14142 & country_id==16 & partyname=="S"
replace voteshare_nextelection=34.99 if next_election==17061 & elecdate==15598 & country_id==16 & partyname=="S"

replace voteshare_nextelection=6.56 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="C"
replace voteshare_nextelection=5.6 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="KD"
replace voteshare_nextelection=7.06 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="L"
replace voteshare_nextelection=30.06 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="M"

replace voteshare_nextelection=6.11 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="C"
replace voteshare_nextelection=4.57 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="KD"
replace voteshare_nextelection=5.42 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="L"
replace voteshare_nextelection=23.32 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="M"

replace voteshare_nextelection=4.41 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="MP"
replace voteshare_nextelection=28.26 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="S"


* UK *

replace voteshare_nextelection=46.11 if next_election==-3599 & elecdate==-5293 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=48.78 if next_election==-2990 & elecdate==-3599 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=49.74 if next_election==-1681 & elecdate==-2990 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=49.35 if next_election==-85 & elecdate==-1681 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=43.4 if next_election==1749 & elecdate==-85 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=48.03 if next_election==2281 & elecdate==1749 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=43.07 if next_election==3821 & elecdate==2281 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=37.88 if next_election==5172 & elecdate==3821 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=39.25 if next_election==5396 & elecdate==5172 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=36.94 if next_election==7062 & elecdate==5396 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=42.42 if next_election==8560 & elecdate==7062 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=42.3 if next_election==10023 & elecdate==8560 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=41.93 if next_election==11787 & elecdate==10023 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=30.69 if next_election==13635 & elecdate==11787 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=40.67 if next_election==15133 & elecdate==13635 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=35.19 if next_election==16561 & elecdate==15133 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=29 if next_election==18388 & elecdate==16561 & country_id==17 & partyname=="Lab"

replace voteshare_nextelection=36.88 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Con"
replace voteshare_nextelection=7.86 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Lib"

replace voteshare_nextelection=42.34 if next_election==20978 & elecdate==20215 & country_id==17 & partyname=="Con"

replace voteshare_nextelection=43.59 if next_election==20978+917 & elecdate==20978 & country_id==17 & partyname=="Con"


** PARTY'S VOTE SHARE, PREVIOUS ELECTION ** 

gen voteshare_nextelectiont1=.

* AUSTRIA *

replace voteshare_nextelectiont1=38.71 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=44.03 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=41.26 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont1=42.11 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=45.96 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont1=43.05 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=44.79 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=44.19 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=44 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=45.43 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=48.35 if next_election==3712 & elecdate==2256 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=48.42 if next_election==4300 & elecdate==3712 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=50.04 if next_election==5756 & elecdate==4300 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=50.42 if next_election==7065 & elecdate==5756 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=51.03 if next_election==8514 & elecdate==7065 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=4.98 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont1=57.65 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=43.12 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=41.29 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=32.06 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont1=42.78 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=34.92 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=27.67 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=28.29 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont1=38.06 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont1=26.91 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont1=26.91 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="FPÖ"

replace voteshare_nextelectiont1=10.01 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont1=42.3 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=34.33 if next_election==17803 & elecdate==17075 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=29.26 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=25.98 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=26.82 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont1=23.99 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont1=25.97 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont1=31.47 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="ÖVP"


* BELGIUM * 
replace voteshare_nextelectiont1=42.54 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont1=9.24 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelectiont1=32.85 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont1=43.55 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont1=15.25 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelectiont1=47.68 if next_election==-2091 & elecdate==-3498 & country_id==2 & partyname=="CVP-PSC"

replace voteshare_nextelectiont1=12.63 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelectiont1=38.99 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont1=46.5 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont1=11.47 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelectiont1=41.46 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont1=36.72 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont1=34.45 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont1=21.61 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelectiont1=28.28 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont1=20.03 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=11.71 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=27.99 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont1=19.69 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=10.38 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=4.54 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=27.24 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="PSB-BSP"
replace voteshare_nextelectiont1=9.48 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=23.25 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=9.09 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=3.81 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=5.86 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="RW"
replace voteshare_nextelectiont1=9.6 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=26.19 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=9.75 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=4.26 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="FDF"
replace voteshare_nextelectiont1=27.04 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="PSB-BSP"
replace voteshare_nextelectiont1=10.04 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="VU"

replace voteshare_nextelectiont1=26.13 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=10.13 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=4.25 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="FDF"
replace voteshare_nextelectiont1=5.2 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=13.01 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=12.37 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont1=10.35 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=19.34 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=7.15 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=8.57 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=12.89 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=21.29 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=7.95 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=10.21 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=10.75 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=19.45 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=8.01 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=15.65 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=14.88 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont1=8.05 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="VU"

replace voteshare_nextelectiont1=16.82 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=7.74 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=13.49 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=11.98 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="SP"

replace voteshare_nextelectiont1=17.18 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=7.73 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=11.87 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=12.56 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="SP"


replace voteshare_nextelectiont1=7.36 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="E"
replace voteshare_nextelectiont1=6.99 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="G"
replace voteshare_nextelectiont1=10.14 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=10.16 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=9.55 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont1=14.3 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=11.4 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=13.02 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=14.91 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont1=15.36 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=14.81 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=6.06 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=21.52 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=10.86 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=11.83 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=10.85 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=5.52 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont1=9.28 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=13.7 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont1=9.24 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont1=8.64 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont1=11.61 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont1=9.64 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont1=20.26 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="N-VA"
replace voteshare_nextelectiont1=9.63 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="VLD"



** DENMARK **

replace voteshare_nextelectiont1=23.38 if next_election==-4448 & elecdate==-5176 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=40.02 if next_election==-3405 & elecdate==-4448 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=17.78 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=39.59 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont1=21.33 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=17.31 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=22.06 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=41.31 if next_election==-962 & elecdate==-2292 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=5.31 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RF"
replace voteshare_nextelectiont1=7.78 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=39.4 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=5.8 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=42.1 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=41.94 if next_election==2517 & elecdate==1726 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=38.26 if next_election==2944 & elecdate==2517 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=20.36 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=14.97 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=18.57 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=37.27 if next_election==5086 & elecdate==4281 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=12.26 if next_election==5487 & elecdate==5086 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=29.95 if next_election==6255 & elecdate==5487 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=37.03 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="S" 
replace voteshare_nextelectiont1=11.97 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="V" 

replace voteshare_nextelectiont1=38.27 if next_election==8012 & elecdate==7235 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=8.28 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont1=14.45 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=2.31 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont1=32.87 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont1=11.31 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=4.6 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont1=23.45 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=2.73 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont1=12.07 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=4.79 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont1=20.84 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=2.37 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont1=10.54 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=19.29 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="KF" 
replace voteshare_nextelectiont1=5.58 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="RV" 
replace voteshare_nextelectiont1=11.84 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="V" 

replace voteshare_nextelectiont1=5.11 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont1=15.97 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=2.29 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont1=3.55 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=37.38 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont1=15.79 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=2.84 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont1=4.59 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=34.56 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=3.85 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=35.93 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont1=9.07 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=31.25 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=10.27 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=29.03 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=10.39 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=26.26 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont1=9.48 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont1=24.86 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont1=9.2 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="SF"

replace voteshare_nextelectiont1=3.35 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont1=7.53 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="LA"
replace voteshare_nextelectiont1=19.47 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="V"


* FINLAND * 

replace voteshare_nextelectiont1=21.35 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=8.38 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=25.08 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=23.47 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont1=24.24 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=3.91 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=7.74 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=26.32 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont1=23.26 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=7.57 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=26.52 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont1=24.1 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="KESK" 
replace voteshare_nextelectiont1=7.88 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="LKP" 
replace voteshare_nextelectiont1=6.98 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="RKP" 
replace voteshare_nextelectiont1=26.25 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="SDP" 

replace voteshare_nextelectiont1=23.06 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=15.28 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.89 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=6.73 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=23.16 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont1=22.95 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=14.65 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.95 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=6.41 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=4.36 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="TPSL"

replace voteshare_nextelectiont1=21.23 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=5.98 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=27.23 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=21.21 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont1=2.58 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="TPSL"

replace voteshare_nextelectiont1=17.12 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=5.95 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=5.7 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=23.43 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=16.59 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont1=16.41 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=5.16 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=5.36 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=25.79 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont1=17.63 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=4.35 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=5.01 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=24.86 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=18.89 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont1=17.29 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=3.68 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont1=4.55 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=23.89 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=17.9 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont1=17.63 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=4.93 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=26.71 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=9.69 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SMP"

replace voteshare_nextelectiont1=23.13 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.62 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=24.14 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=6.32 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SMP"

replace voteshare_nextelectiont1=24.82 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=19.31 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.83 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=3.05 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="SKL"

replace voteshare_nextelectiont1=17.89 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.49 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=28.25 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=11.16 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont1=6.52 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont1=21.03 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=5.51 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=22.86 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=10.88 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont1=7.27 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont1=24.69 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=4.61 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=24.47 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont1=23.11 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=22.26 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=4.97 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=8.46 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont1=20.38 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=4.28 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont1=19.1 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont1=8.13 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont1=4.03 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKL"
replace voteshare_nextelectiont1=7.25 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont1=21.1 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont1=18.2 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont1=17.65 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="SMP"



* GERMANY * 

replace voteshare_nextelectiont1=31.01 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="CDU-SCU"
replace voteshare_nextelectiont1=3.96 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="DP"
replace voteshare_nextelectiont1=11.92 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=45.17 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="CDU-CSU" 
replace voteshare_nextelectiont1=3.25 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="DP" 
replace voteshare_nextelectiont1=9.54 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="FDP" 
replace voteshare_nextelectiont1=5.87 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="GB-BHE" 

replace voteshare_nextelectiont1=50.19 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=3.37 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="DP"

replace voteshare_nextelectiont1=45.32 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=12.77 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=47.59 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=9.49 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont1=39.28 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=5.77 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont1=42.67 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=8.36 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont1=45.85 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=7.92 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont1=42.56 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=44.54 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=10.62 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont1=42.86 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=48.79 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=6.95 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=44.26 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=9.11 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=43.82 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=11.03 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=41.44 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=6.92 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=6.7 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="GR"
replace voteshare_nextelectiont1=40.93 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=8.56 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="GR"
replace voteshare_nextelectiont1=38.52 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=35.17 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=34.25 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=33.8 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=14.56 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont1=41.5 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=25.7 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont1=32.92 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont1=20.51 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="SPD"


* GREECE * 

replace voteshare_nextelectiont1=41.84 if next_election==7961 & elecdate==6533 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont1=48.07 if next_election==9284 & elecdate==7961 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=45.82 if next_election==10761 & elecdate==9284 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=44.28 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont1=10.97 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="SYN"

replace voteshare_nextelectiont1=46.19 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont1=40.68 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="PASOK"
replace voteshare_nextelectiont1=10.97 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="SYN"

replace voteshare_nextelectiont1=46.89 if next_election==12336 & elecdate==11055 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont1=46.88 if next_election==13414 & elecdate==12336 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=41.49 if next_election==14709 & elecdate==13414 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=43.79 if next_election==16137 & elecdate==14709 & country_id==7 & partyname=="PASOK"    

replace voteshare_nextelectiont1=45.36 if next_election==17425 & elecdate==16137 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont1=41.84 if next_election==18174 & elecdate==17425 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont1=5.63 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="LAOS"
replace voteshare_nextelectiont1=33.48 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont1=43.92 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=29.66 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont1=12.28 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont1=4.63 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="ANEL"
replace voteshare_nextelectiont1=36.34 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="SYRIZA"

replace voteshare_nextelectiont1=3.6 if next_election==20351+1386 & elecdate==20351 & country_id==7 & partyname=="ANEL"
replace voteshare_nextelectiont1=35.46 if next_election==20351+1386 & elecdate==20351 & country_id==7 & partyname=="SYRIZA"
 
 
* ICELAND * 
 
replace voteshare_nextelectiont1=39.5 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=23.06 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont1=17.8 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SDP"
replace voteshare_nextelectiont1=19.5 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SP"

replace voteshare_nextelectiont1=39.53 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=24.45 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=37.12 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=21.91 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=19.18 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont1=15.63 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont1=18.33 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=12.54 if next_election==-67 & elecdate==-187 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=39.72 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=15.17 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=41.43 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=14.21 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=37.5 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=15.67 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=10.46 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont1=25.28 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont1=8.91 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="ULL"

replace voteshare_nextelectiont1=42.73 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=24.87 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=22.87 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont1=16.9 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont1=22.02 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=35.42 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=19.72 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont1=24.94 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=38.53 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=18.48 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=10.86 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="CP"
replace voteshare_nextelectiont1=27.17 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=13.35 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont1=18.93 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont1=15.23 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=38.56 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=15.5 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont1=37.07 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=23.32 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=40.74 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=18.35 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=33.69 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=17.73 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=36.64 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=14.35 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont1=26.76 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="SDA"

replace voteshare_nextelectiont1=21.68 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont1=29.79 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="SDA"

replace voteshare_nextelectiont1=26.7 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=24.43 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont1=7.16 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="BF"
replace voteshare_nextelectiont1=29 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=10.48 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="RP"

replace voteshare_nextelectiont1=25.25 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont1=16.89 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont1=10.71 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="PP"
 

* IRELAND *  
 
replace voteshare_nextelectiont1=13.21 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnP"
replace voteshare_nextelectiont1=5.58 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnT"
replace voteshare_nextelectiont1=19.83 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=8.7 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=46.28 if next_election==-2054 & elecdate==-3138 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=3.83 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="CnT"
replace voteshare_nextelectiont1=31.98 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=12.06 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=48.33 if next_election==642 & elecdate==-1032 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=43.83 if next_election==1923 & elecdate==642 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=47.67 if next_election==3456 & elecdate==1923 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=45.66 if next_election==4807 & elecdate==3456 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=35.08 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=13.67 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=50.63 if next_election==7832 & elecdate==6376 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=36.45 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=9.89 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=47.26 if next_election==8363 & elecdate==8084 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=39.22 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=9.36 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=44.15 if next_election==10758 & elecdate==9909 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont1=44.15 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont1=5.49 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont1=39.11 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont1=24.47 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=19.31 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="Lab"
replace voteshare_nextelectiont1=2.78 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="WP-DL"

replace voteshare_nextelectiont1=39.33 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont1=4.68 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont1=41.48 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont1=3.96 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont1=41.56 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont1=4.69 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="GR"
replace voteshare_nextelectiont1=2.73 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont1=36.1 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont1=19.45 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont1=25.52 if next_election==20510+1443 & elecdate==20510 & country_id==9 & partyname=="FG"


* Italy *

replace voteshare_nextelectiont1=35.2 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=18.93 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PCI-PDS-DS"
replace voteshare_nextelectiont1=6.78 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=4.78 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=20.7 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=48.5 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=3.83 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=2.48 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=7.07 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont1=40.1 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=3.01 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=4.51 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont1=42.35 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=1.37 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=4.55 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont1=38.19 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=1.37 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=6.1 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=13.84 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=39.01 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=1.97 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PRI"

replace voteshare_nextelectiont1=38.66 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=3.88 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=2.86 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=5.14 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=9.61 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=38.71 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=3.09 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=3.37 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont1=38.29 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=1.95 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=3.02 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=3.84 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=9.8 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=32.92 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=2.9 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=5.08 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=4.08 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=11.44 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=34.3 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=2.1 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=3.7 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont1=2.96 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=14.26 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=29.66 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont1=2.85 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont1=2.71 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont1=13.61 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont1=13.48 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="AN"
replace voteshare_nextelectiont1=. if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="CCD-CDU-UDC"
replace voteshare_nextelectiont1=21.04 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont1=8.62 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="LN"

replace voteshare_nextelectiont1=21.06 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PCI-PDS-DS"
replace voteshare_nextelectiont1=6.81 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PPI"
replace voteshare_nextelectiont1=4.34 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="RI"
replace voteshare_nextelectiont1=2.5 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="Verdi"

replace voteshare_nextelectiont1=12.01 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="AN"
replace voteshare_nextelectiont1=29.42 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont1=0.95 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="NPSI"

replace voteshare_nextelectiont1=2.3 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="IdV"
replace voteshare_nextelectiont1=2.32 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="PdCI"
replace voteshare_nextelectiont1=2.6 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="RnP"
replace voteshare_nextelectiont1=1.4 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="UDR-UDEUR"
replace voteshare_nextelectiont1=2.05 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="Verdi"

replace voteshare_nextelectiont1=37.22 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont1=8.07 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="LN"

replace voteshare_nextelectiont1=21.57 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont1=25.42 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="PD"
replace voteshare_nextelectiont1=8.3 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="SC"


* The Netherlands *

replace voteshare_nextelectiont1=30.81 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=28.31 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=9.19 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=31.04 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=25.6 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont1=7.95 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=11.31 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=8.93 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=28.66 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=28.97 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=9.91 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=8.43 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=31.69 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=32.69 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=9.39 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=8.11 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=31.6 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=12.21 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=8.72 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=8.58 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=31.88 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=28.01 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont1=10.29 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=9.9 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=8.14 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont1=26.5 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=10.73 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=8.59 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=21.84 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=10.34 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=8.84 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont1=4.15 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=17.66 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont1=4.8 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PPR"
replace voteshare_nextelectiont1=27.34 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=31.89 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=17.95 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=30.81 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=11.06 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=28.29 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=29.39 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=23.08 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=34.59 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=17.41 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=35.31 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=31.88 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=15.49 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=23.97 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont1=19.96 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=8.99 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=28.98 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont1=24.96 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=27.93 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=17 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="LPF"
replace voteshare_nextelectiont1=15.44 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=28.65 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=4.08 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=17.95 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=26.51 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=3.97 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CU"
replace voteshare_nextelectiont1=21.19 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont1=13.62 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=20.47 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=24.84 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont1=26.58 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont1=12.38 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont1=3.39 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CU"
replace voteshare_nextelectiont1=12.23 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont1=21.29 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="VVD"


* NORWAY *

replace voteshare_nextelectiont1=41.03 if next_election==-3735 & elecdate==-5198 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=45.69 if next_election==-2272 & elecdate==-3735 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=46.99 if next_election==-816 & elecdate==-2272 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=48.33 if next_election==619 & elecdate==-816 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=46.76 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=21.28 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=10.37 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=7.95 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont1=8.18 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont1=20.99 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=8.7 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=9.79 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont1=10.56 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont1=46.52 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=20.59 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=8.7 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=10.21 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont1=9.38 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont1=35.29 if next_election==6464 & elecdate==5001 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=42.26 if next_election==7927 & elecdate==6464 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=31.74 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=8.91 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=7.28 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont1=40.81 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=30.42 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=8.26 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=6.6 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont1=34.27 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=22.23 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=8.49 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=6.47 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont1=36.91 if next_election==13772 & elecdate==12309 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont1=35 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=13.66 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=7.93 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont1=4.45 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont1=21.21 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=12.4 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=3.9 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont1=32.69 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=8.83 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelectiont1=6.48 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont1=35.38 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont1=6.2 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelectiont1=6.15 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont1=16.34 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="FRP"
replace voteshare_nextelectiont1=26.81 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="H"

replace voteshare_nextelectiont1=15.19 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="FRP"
replace voteshare_nextelectiont1=25.04 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont1=4.2 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont1=4.37 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="V"
 

* PORTUGAL *
 
replace voteshare_nextelectiont1=16.69 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont1=36.74 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont1=15.21 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont1=1.81 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PPM"
replace voteshare_nextelectiont1=27.51 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=16.57 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont1=2.16 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PPM"
replace voteshare_nextelectiont1=29.53 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=37.34 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PS"
replace voteshare_nextelectiont1=27.77 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=30.59 if next_election==10061 & elecdate==9410 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=51.29 if next_election==11601 & elecdate==10061 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=50.99 if next_election==13057 & elecdate==11601 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=44.61 if next_election==14527 & elecdate==13057 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont1=44.41 if next_election==15416 & elecdate==14527 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont1=8.9 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont1=41.01 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=46.4 if next_election==18167 & elecdate==16487 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont1=37.73 if next_election==18783 & elecdate==18167 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont1=12.21 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont1=40.31 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont1=33.57 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PS"


* SPAIN
 
replace voteshare_nextelectiont1=34.83 if next_election==6999 & elecdate==6375 & country_id==15 & partyname=="UCD"

replace voteshare_nextelectiont1=35.05 if next_election==8336 & elecdate==6999 & country_id==15 & partyname=="UCD"

replace voteshare_nextelectiont1=48.38 if next_election==9669 & elecdate==8336 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=44.34 if next_election==10894 & elecdate==9669 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=39.88 if next_election==12210 & elecdate==10894 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=39.1 if next_election==13211 & elecdate==12210 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=38.79 if next_election==14681 & elecdate==13211 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont1=44.52 if next_election==16144 & elecdate==14681 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont1=42.59 if next_election==17600 & elecdate==16144 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=44.14 if next_election==18951 & elecdate==17600 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont1=45.24 if next_election==20442 & elecdate==18951 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont1=28.7 if next_election==20631 & elecdate==20442 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont1=33.02 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PP"
replace voteshare_nextelectiont1=22.63 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PSOE"

** SWEDEN **

replace voteshare_nextelectiont1=46.5 if next_election==-4121 & elecdate==-5584 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=12.38 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=46.13 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=10.73 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="C" 
replace voteshare_nextelectiont1=46.05 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="S" 

replace voteshare_nextelectiont1=9.45 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=44.58 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=46.22 if next_election==261 & elecdate==-579 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=47.79 if next_election==1724 & elecdate==261 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=47.27 if next_election==3180 & elecdate==1724 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=50.12 if next_election==3915 & elecdate==3180 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=45.34 if next_election==5007 & elecdate==3915 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=43.56 if next_election==6106 & elecdate==5007 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=24.09 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=11.06 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont1=15.59 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont1=18.07 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=10.59 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont1=20.34 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="M"


replace voteshare_nextelectiont1=45.61 if next_election==9389 & elecdate==8297 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=44.68 if next_election==10488 & elecdate==9389 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=43.21 if next_election==11580 & elecdate==10488 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=8.5 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=7.13 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="KD"
replace voteshare_nextelectiont1=9.13 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont1=21.92 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont1=45.25 if next_election==14142 & elecdate==12679 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=36.39 if next_election==15598 & elecdate==14142 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont1=39.85 if next_election==17061 & elecdate==15598 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont1=7.88 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=6.59 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="KD"
replace voteshare_nextelectiont1=7.54 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont1=26.23 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont1=6.56 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont1=5.6 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="KD"
replace voteshare_nextelectiont1=7.06 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont1=30.06 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont1=6.89 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="MP"
replace voteshare_nextelectiont1=31.02 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="S"


* UK *

replace voteshare_nextelectiont1=48 if next_election==-3599 & elecdate==-5293 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=46.11 if next_election==-2990 & elecdate==-3599 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=47.97 if next_election==-1681 & elecdate==-2990 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=49.74 if next_election==-85 & elecdate==-1681 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=49.35 if next_election==1749 & elecdate==-85 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=44.13 if next_election==2281 & elecdate==1749 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=48.03 if next_election==3821 & elecdate==2281 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=46.38 if next_election==5172 & elecdate==3821 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=37.16 if next_election==5396 & elecdate==5172 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=39.25 if next_election==7062 & elecdate==5396 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=43.87 if next_election==8560 & elecdate==7062 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=42.42 if next_election==10023 & elecdate==8560 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=42.3 if next_election==11787 & elecdate==10023 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=41.93 if next_election==13635 & elecdate==11787 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=43.21 if next_election==15133 & elecdate==13635 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=40.67 if next_election==16561 & elecdate==15133 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=35.19 if next_election==18388 & elecdate==16561 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont1=36.13 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Con"
replace voteshare_nextelectiont1=23 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Lib"

replace voteshare_nextelectiont1=36.88 if next_election==20978 & elecdate==20215 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont1=42.34 if next_election==20978+917 & elecdate==20978 & country_id==17 & partyname=="Con"



** PARTY'S VOTE SHARE T-2 ELECTION ** 

gen voteshare_nextelectiont2=.

* AUSTRIA *

replace voteshare_nextelectiont2=44.03 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont2=38.71 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=41.26 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont2=42.11 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=43.05 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=45.96 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=44.79 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=44.19 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=45.43 if next_election==3712 & elecdate==2256 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=42.56 if next_election==4300 & elecdate==3712 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=48.42 if next_election==5756 & elecdate==4300 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=50.04 if next_election==7065 & elecdate==5756 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=50.42 if next_election==8514 & elecdate==7065 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=6.06 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont2=51.03 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=47.65 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=43.22 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=41.29 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont2=43.12 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=42.78 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=32.06 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=27.67 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont2=34.92 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="SPÖ"

replace voteshare_nextelectiont2=28.29 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="ÖVP"
replace voteshare_nextelectiont2=21.89 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="FPÖ"

replace voteshare_nextelectiont2=26.91 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont2=26.91 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=42.3 if next_election==17803 & elecdate==17075 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=35.34 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=34.33 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=29.26 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="SPÖ"
replace voteshare_nextelectiont2=25.98 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="ÖVP"

replace voteshare_nextelectiont2=20.51 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="FPÖ"
replace voteshare_nextelectiont2=23.99 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="ÖVP"


* BELGIUM * 

replace voteshare_nextelectiont2=42.54 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont2=9.24 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelectiont2=43.55 if next_election==-2091 & elecdate==-3498 & country_id==2 & partyname=="CVP-PSC"

replace voteshare_nextelectiont2=11.61 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelectiont2=35.91 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont2=41.15 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont2=12.63 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="LP-PL"

replace voteshare_nextelectiont2=46.5 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont2=37.47 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont2=41.46 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="CVP-PSC"
replace voteshare_nextelectiont2=12.33 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="LP-PL"
replace voteshare_nextelectiont2=36.72 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont2=28.28 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont2=20.03 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=11.71 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=2.52 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=27.99 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="PSB-BSP"

replace voteshare_nextelectiont2=19.67 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=10.38 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=4.54 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=6.69 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="RW"
replace voteshare_nextelectiont2=9.48 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=23.25 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=9.09 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=3.81 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="FDF"
replace voteshare_nextelectiont2=26.66 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="PSB-BSP"
replace voteshare_nextelectiont2=10.2 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="VU"

replace voteshare_nextelectiont2=26.19 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=9.75 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=4.26 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="FDF"
replace voteshare_nextelectiont2=5.89 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=8.54 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=26.13 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=10.13 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=5.2 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=10.35 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=19.34 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=7.15 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=8.57 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=12.89 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=21.29 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=7.95 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=13.76 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=14.55 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont2=7.88 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="VU"

replace voteshare_nextelectiont2=19.45 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=8.01 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=15.65 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=14.88 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="SP"

replace voteshare_nextelectiont2=16.82 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=7.74 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=13.49 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=11.98 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="SP"


replace voteshare_nextelectiont2=4.01 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="E"
replace voteshare_nextelectiont2=4.43 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="G"
replace voteshare_nextelectiont2=10.26 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=11.87 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=12.56 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont2=13.15 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=10.14 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=10.16 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=9.55 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont2=14.3 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=13.25 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=5.47 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=11.4 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=13.02 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=14.91 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=14.81 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=6.06 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CdH"
replace voteshare_nextelectiont2=12.52 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=10.86 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="PS"
replace voteshare_nextelectiont2=10.26 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="SP"
replace voteshare_nextelectiont2=11.83 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="VLD"

replace voteshare_nextelectiont2=10.85 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="CDV"
replace voteshare_nextelectiont2=9.28 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="MR"
replace voteshare_nextelectiont2=17.4 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="N-VA"
replace voteshare_nextelectiont2=8.64 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="VLD"



** DENMARK **

replace voteshare_nextelectiont2=32.78 if next_election==-3405 & elecdate==-4448 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=12.44 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=40.02 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont2=27.58 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=17.78 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=21.33 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=40.39 if next_election==-962 & elecdate==-2292 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=3.48 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RF"
replace voteshare_nextelectiont2=7.82 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=41.31 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=7.78 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=39.4 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=42.1 if next_election==2517 & elecdate==1726 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=41.94 if next_election==2944 & elecdate==2517 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=18.68 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=7.3 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=19.29 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=34.15 if next_election==5086 & elecdate==4281 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=15.63 if next_election==5487 & elecdate==5086 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=25.65 if next_election==6255 & elecdate==5487 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=29.95 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="S" 
replace voteshare_nextelectiont2=23.32 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="V" 

replace voteshare_nextelectiont2=37.03 if next_election==8012 & elecdate==7235 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=3.22 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont2=12.48 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=2.59 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont2=38.27 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont2=12.5 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=8.28 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont2=14.45 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=2.31 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont2=11.31 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=4.6 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont2=23.45 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=2.73 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont2=12.07 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=20.84 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="KF" 
replace voteshare_nextelectiont2=6.22 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="RV" 
replace voteshare_nextelectiont2=10.54 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="V" 

replace voteshare_nextelectiont2=4.67 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont2=19.29 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=2.04 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KrF"
replace voteshare_nextelectiont2=5.58 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=29.82 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont2=11.84 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=5.11 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="CD"
replace voteshare_nextelectiont2=3.55 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=37.38 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=4.59 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=34.56 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="S"

replace voteshare_nextelectiont2=8.92 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=24.01 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=9.07 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=31.25 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=10.27 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=29.03 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="V"

replace voteshare_nextelectiont2=5.12 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="RV"
replace voteshare_nextelectiont2=25.47 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="S"
replace voteshare_nextelectiont2=13.04 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="SF"

replace voteshare_nextelectiont2=4.92 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="KF"
replace voteshare_nextelectiont2=4.98 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="LA"
replace voteshare_nextelectiont2=26.74 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="V"


* FINLAND * 

replace voteshare_nextelectiont2=21.35 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=5.17 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=8.38 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=25.08 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont2=24.24 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=7.74 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=26.32 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont2=23.26 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="KESK" 
replace voteshare_nextelectiont2=5.68 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="LKP" 
replace voteshare_nextelectiont2=7.57 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="RKP" 
replace voteshare_nextelectiont2=26.52 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="SDP" 
replace voteshare_nextelectiont2=21.58 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="TPSL" 

replace voteshare_nextelectiont2=24.1 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=12.8 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=7.88 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=6.98 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=26.25 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont2=23.06 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=15.28 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=5.89 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=6.73 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=1.75 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="TPSL"

replace voteshare_nextelectiont2=22.95 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=6.41 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=19.5 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=22.03 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont2=4.36 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="TPSL"

replace voteshare_nextelectiont2=21.23 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=6.47 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=5.98 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=27.23 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=21.21 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont2=17.12 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=5.95 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=5.7 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=23.43 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont2=16.41 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=5.16 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=5.36 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=25.79 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=17.02 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont2=17.63 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=4.35 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="LKP"
replace voteshare_nextelectiont2=5.01 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=24.86 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=18.89 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SKDL"

replace voteshare_nextelectiont2=17.29 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=4.55 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=23.89 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=4.58 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SMP"

replace voteshare_nextelectiont2=22.12 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=4.93 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=26.71 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=9.69 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SMP"

replace voteshare_nextelectiont2=17.62 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=23.13 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=5.62 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=2.58 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="SKL"

replace voteshare_nextelectiont2=19.31 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=5.83 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=22.12 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=10.07 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont2=6.82 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont2=17.89 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=5.49 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=28.25 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=11.16 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont2=6.52 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont2=22.4 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=5.51 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=22.86 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="SDP"

replace voteshare_nextelectiont2=24.69 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=18.55 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=4.61 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=8.46 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont2=22.26 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=4.97 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="RKP"
replace voteshare_nextelectiont2=21.44 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SDP"
replace voteshare_nextelectiont2=8.82 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKDL"
replace voteshare_nextelectiont2=4.97 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKL"
replace voteshare_nextelectiont2=8.46 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="VIHR"

replace voteshare_nextelectiont2=15.65 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KESK"
replace voteshare_nextelectiont2=20.38 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KOK"
replace voteshare_nextelectiont2=19.05 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="SMP"


* GERMANY * 

replace voteshare_nextelectiont2=31.01 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="CDU-CSU" 
replace voteshare_nextelectiont2=3.96 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="DP" 
replace voteshare_nextelectiont2=11.92 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="FDP" 

replace voteshare_nextelectiont2=45.17 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=3.25 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="DP"

replace voteshare_nextelectiont2=50.19 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=7.71 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=45.32 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=12.77 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont2=36.22 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=9.49 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont2=39.28 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=5.77 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont2=42.67 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=8.36 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont2=45.85 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=48.63 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=7.92 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="FDP"
replace voteshare_nextelectiont2=42.56 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=44.54 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=10.62 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=48.79 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=6.95 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=44.26 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=9.11 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=43.82 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=11.03 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=7.27 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="GR"
replace voteshare_nextelectiont2=36.39 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=6.7 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="GR"
replace voteshare_nextelectiont2=40.93 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=38.5 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=7.37 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=35.17 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=9.83 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="FDP"

replace voteshare_nextelectiont2=33.8 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=23.04 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="SPD"

replace voteshare_nextelectiont2=41.5 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="CDU-CSU"
replace voteshare_nextelectiont2=25.7 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="SPD"


* GREECE * 

replace voteshare_nextelectiont2=25.34 if next_election==9284 & elecdate==7961 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=48.07 if next_election==10761 & elecdate==9284 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=40.84 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont2=44.28 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont2=39.13 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=46.19 if next_election==12336 & elecdate==11055 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont2=38.61 if next_election==13414 & elecdate==12336 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=46.88 if next_election==14709 & elecdate==13414 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=41.49 if next_election==16137 & elecdate==14709 & country_id==7 & partyname=="PASOK"    
     
replace voteshare_nextelectiont2=42.73 if next_election==17425 & elecdate==16137 & country_id==7 & partyname=="ND" 

replace voteshare_nextelectiont2=45.36 if next_election==18174 & elecdate==17425 & country_id==7 & partyname=="ND"

replace voteshare_nextelectiont2=3.79 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="LAOS"
replace voteshare_nextelectiont2=41.84 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont2=38.1 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=6.11 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="DIMAR"
replace voteshare_nextelectiont2=18.85 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="ND"
replace voteshare_nextelectiont2=13.18 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="PASOK"

replace voteshare_nextelectiont2=7.51 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="ANEL"
replace voteshare_nextelectiont2=26.89 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="SYRIZA"

replace voteshare_nextelectiont2=4.63 if next_election==20351+1386 & elecdate==20351 & country_id==7 & partyname=="ANEL"
replace voteshare_nextelectiont2=36.34 if next_election==20351+1386 & elecdate==20351 & country_id==7 & partyname=="SYRIZA"
 
* ICELAND * 

replace voteshare_nextelectiont2=39.5 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=23.06 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=39.53 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=24.45 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=21.91 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont2=15.62 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=18.33 if next_election==-67 & elecdate==-187 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=42.49 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=27.2 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=39.72 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=25.71 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=41.43 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=14.21 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=13.95 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont2=28.13 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont2=3.66 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="ULL"

replace voteshare_nextelectiont2=36.22 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=25.28 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=18.34 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont2=24.87 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont2=9.07 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=32.72 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=22.87 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont2=16.9 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=35.42 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=24.94 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=38.53 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=17.24 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PA"
replace voteshare_nextelectiont2=18.48 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PP"
replace voteshare_nextelectiont2=11.66 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=27.17 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=15.23 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="SDP"

replace voteshare_nextelectiont2=38.56 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=18.93 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=37.07 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=23.32 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=40.74 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=18.35 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=33.69 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=8.8 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont2=30.95 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="SDA"

replace voteshare_nextelectiont2=14.35 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont2=26.76 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="SDA"

replace voteshare_nextelectiont2=23.7 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=14.8 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="PP"

replace voteshare_nextelectiont2=8.24 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="BF"
replace voteshare_nextelectiont2=26.7 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=24.43 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="RP"

replace voteshare_nextelectiont2=29 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="IP"
replace voteshare_nextelectiont2=15.91 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="LG"
replace voteshare_nextelectiont2=14.49 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="PP"
 
 
* IRELAND *  
 
replace voteshare_nextelectiont2=41.85 if next_election==-2054 & elecdate==-3138 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=2.92 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="CnT"
replace voteshare_nextelectiont2=25.75 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=11.4 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont2=43.36 if next_election==642 & elecdate==-1032 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=48.33 if next_election==1923 & elecdate==642 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=43.83 if next_election==3456 & elecdate==1923 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=47.67 if next_election==4807 & elecdate==3456 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=34.1 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=17.02 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont2=46.24 if next_election==7832 & elecdate==6376 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=30.49 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=11.63 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont2=45.26 if next_election==8363 & elecdate==8084 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=37.3 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=9.12 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont2=45.2 if next_election==10758 & elecdate==9909 & country_id==9 & partyname=="FF"

replace voteshare_nextelectiont2=44.15 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont2=11.85 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont2=44.15 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont2=29.29 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=9.47 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="Lab"
replace voteshare_nextelectiont2=4.96 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="WP-DL"

replace voteshare_nextelectiont2=93.11 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont2=4.68 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont2=39.33 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont2=4.68 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont2=41.48 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="FF"
replace voteshare_nextelectiont2=3.85 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="GR"
replace voteshare_nextelectiont2=3.96 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="PD"

replace voteshare_nextelectiont2=27.32 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="FG"
replace voteshare_nextelectiont2=10.13 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="Lab"

replace voteshare_nextelectiont2=36.1 if next_election==20510+1443 & elecdate==20510 & country_id==9 & partyname=="FG"


* Italy *

replace voteshare_nextelectiont2=35.2 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=6.78 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=4.78 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=20.7 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont2=48.5 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=3.83 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=7.07 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont2=40.1 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=1.62 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=4.51 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont2=42.35 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=1.37 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=4.55 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=14.23 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=38.19 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=1.37 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=6.1 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=13.84 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=39.01 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=5.82 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=1.97 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PRI"

replace voteshare_nextelectiont2=38.66 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=2.86 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=5.14 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PSDI"

replace voteshare_nextelectiont2=38.71 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=1.3 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=3.09 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=3.37 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=9.64 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=38.29 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=1.95 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=3.02 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=3.84 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=9.8 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=32.92 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=2.9 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=5.08 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PRI"
replace voteshare_nextelectiont2=4.08 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=11.44 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=34.3 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="DC"
replace voteshare_nextelectiont2=2.1 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PLI"
replace voteshare_nextelectiont2=2.96 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSDI"
replace voteshare_nextelectiont2=14.26 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSI"

replace voteshare_nextelectiont2=8.66 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="LN"

replace voteshare_nextelectiont2=2.7 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="Verdi"

replace voteshare_nextelectiont2=15.67 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="AN"
replace voteshare_nextelectiont2=20.57 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont2=10.07 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="LN"

replace voteshare_nextelectiont2=3.9 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="IdV"
replace voteshare_nextelectiont2=1.67 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="PdCI"

replace voteshare_nextelectiont2=23.71 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="FI-PdL"
replace voteshare_nextelectiont2=4.58 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="LN"

replace voteshare_nextelectiont2=1.79 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="CCD-CDU-UDC"
replace voteshare_nextelectiont2=25.42 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="PD"
replace voteshare_nextelectiont2=8.3 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="SC"

* The Netherlands *

replace voteshare_nextelectiont2=7.84 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=30.81 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=28.31 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont2=6.41 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=13.21 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=9.19 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=31.04 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=25.6 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=11.31 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=8.93 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=28.66 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=28.97 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=9.91 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=8.43 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=31.69 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=8.77 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=9.39 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=8.11 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=31.6 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=30.36 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont2=12.21 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=8.72 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=8.58 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=31.88 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=10.29 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=9.9 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=8.14 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="CHU"
replace voteshare_nextelectiont2=26.5 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=10.73 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=8.59 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="ARP"
replace voteshare_nextelectiont2=6.78 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=21.84 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="KVP"
replace voteshare_nextelectiont2=1.84 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PPR"
replace voteshare_nextelectiont2=24.6 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=14.45 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=31.89 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=5.44 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=33.83 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=30.81 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=17.32 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=29.39 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=23.08 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=34.59 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=33.27 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=7.89 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=31.88 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont2=14.57 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=15.49 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=23.97 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont2=19.96 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=18.37 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=24.69 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=27.93 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=5.1 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=15.44 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=28.65 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=2.13 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CU"
replace voteshare_nextelectiont2=27.28 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="PvdA"

replace voteshare_nextelectiont2=26.51 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=14.67 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=19.63 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="PvdA"
replace voteshare_nextelectiont2=20.47 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="VVD"

replace voteshare_nextelectiont2=8.51 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CDA"
replace voteshare_nextelectiont2=3.13 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CU"
replace voteshare_nextelectiont2=8.03 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="D66"
replace voteshare_nextelectiont2=26.58 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="VVD"

* NORWAY *

replace voteshare_nextelectiont2=41.03 if next_election==-2272 & elecdate==-3735 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=45.69 if next_election==-816 & elecdate==-2272 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=46.66 if next_election==619 & elecdate==-816 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=48.33 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=18.72 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=10.23 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=9.62 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont2=9.57 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont2=21.28 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=10.37 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=7.95 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont2=8.18 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont2=43.14 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=20.99 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=8.13 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=9.79 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont2=10.56 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont2=46.52 if next_election==6464 & elecdate==5001 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=35.29 if next_election==7927 & elecdate==6464 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=27.08 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=11.13 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=8.75 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont2=37.2 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=31.74 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=8.91 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=7.28 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont2=40.81 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=30.42 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=8.26 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=6.6 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont2=34.27 if next_election==13772 & elecdate==12309 & country_id==13 & partyname=="A"

replace voteshare_nextelectiont2=36.91 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=7.88 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=16.74 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="SP"
replace voteshare_nextelectiont2=3.61 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont2=14.34 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=13.66 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=4.45 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="V"

replace voteshare_nextelectiont2=24.29 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=12.55 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelectiont2=5.56 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont2=32.69 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="A"
replace voteshare_nextelectiont2=8.83 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SF-SV"
replace voteshare_nextelectiont2=6.48 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SP"

replace voteshare_nextelectiont2=22.91 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="FRP"
replace voteshare_nextelectiont2=17.24 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="H"

replace voteshare_nextelectiont2=16.34 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="FRP"
replace voteshare_nextelectiont2=26.81 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="H"
replace voteshare_nextelectiont2=5.59 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="KRF"
replace voteshare_nextelectiont2=5.23 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="V"
 
* PORTUGAL *
 
replace voteshare_nextelectiont2=16.69 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont2=0.55 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PPM"
replace voteshare_nextelectiont2=25.24 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=15.21 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont2=1.81 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PPM"
replace voteshare_nextelectiont2=27.51 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=25.6 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PS"
replace voteshare_nextelectiont2=29.53 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=27.77 if next_election==10061 & elecdate==9410 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=30.59 if next_election==11601 & elecdate==10061 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=51.29 if next_election==13057 & elecdate==11601 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=29.58 if next_election==14527 & elecdate==13057 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont2=44.61 if next_election==15416 & elecdate==14527 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont2=8.46 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont2=32.63 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=38.55 if next_election==18167 & elecdate==16487 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont2=46.4 if next_election==18783 & elecdate==18167 & country_id==14 & partyname=="PS"

replace voteshare_nextelectiont2=10.4 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont2=30.05 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="PSD"

replace voteshare_nextelectiont2=12.21 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="CDS-PP"
replace voteshare_nextelectiont2=29.24 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PS"
replace voteshare_nextelectiont2=40.31 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PSD"

* SPAIN *
 
replace voteshare_nextelectiont2=34.83 if next_election==8336 & elecdate==6999 & country_id==15 & partyname=="UCD"

replace voteshare_nextelectiont2=30.49 if next_election==9669 & elecdate==8336 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=48.38 if next_election==10894 & elecdate==9669 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=44.34 if next_election==12210 & elecdate==10894 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=39.88 if next_election==13211 & elecdate==12210 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=35.04 if next_election==14681 & elecdate==13211 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont2=38.79 if next_election==16144 & elecdate==14681 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont2=34.16 if next_election==17600 & elecdate==16144 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=42.59 if next_election==18951 & elecdate==17600 & country_id==15 & partyname=="PSOE"

replace voteshare_nextelectiont2=40.57 if next_election==20442 & elecdate==18951 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont2=45.24 if next_election==20631 & elecdate==20442 & country_id==15 & partyname=="PP"

replace voteshare_nextelectiont2=28.7 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PP"
replace voteshare_nextelectiont2=22 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PSOE"

** SWEDEN **

replace voteshare_nextelectiont2=13.6 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=46.5 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont2=12.38 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="C" 
replace voteshare_nextelectiont2=46.13 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="S" 

replace voteshare_nextelectiont2=10.73 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=46.05 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont2=44.58 if next_election==261 & elecdate==-579 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=46.22 if next_election==1724 & elecdate==261 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=47.79 if next_election==3180 & elecdate==1724 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=47.27 if next_election==3915 & elecdate==3180 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=50.12 if next_election==5007 & elecdate==3915 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=45.34 if next_election==6106 & elecdate==5007 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont2=25.1 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=9.42 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont2=14.29 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont2=24.09 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=11.06 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont2=15.59 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont2=43.24 if next_election==9389 & elecdate==8297 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=45.61 if next_election==10488 & elecdate==9389 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=44.68 if next_election==11580 & elecdate==10488 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont2=11.3 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=12.2 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont2=18.3 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="M"


replace voteshare_nextelectiont2=37.7 if next_election==14142 & elecdate==12679 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=45.25 if next_election==15598 & elecdate==14142 & country_id==16 & partyname=="S"
replace voteshare_nextelectiont2=36.39 if next_election==17061 & elecdate==15598 & country_id==16 & partyname=="S"

replace voteshare_nextelectiont2=6.19 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=9.15 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="KD"
replace voteshare_nextelectiont2=13.39 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont2=15.26 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont2=7.88 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="C"
replace voteshare_nextelectiont2=6.59 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="KD"
replace voteshare_nextelectiont2=7.54 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="L"
replace voteshare_nextelectiont2=26.23 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="M"

replace voteshare_nextelectiont2=7.34 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="MP"
replace voteshare_nextelectiont2=30.66 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="S"


* UK *

replace voteshare_nextelectiont2=48 if next_election==-2990 & elecdate==-3599 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=43.42 if next_election==-1681 & elecdate==-2990 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=47.97 if next_election==-85 & elecdate==-1681 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=49.74 if next_election==1749 & elecdate==-85 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=43.84 if next_election==2281 & elecdate==1749 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=44.13 if next_election==3821 & elecdate==2281 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=41.88 if next_election==5172 & elecdate==3821 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=43.07 if next_election==5396 & elecdate==5172 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=37.16 if next_election==7062 & elecdate==5396 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=35.84 if next_election==8560 & elecdate==7062 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=43.87 if next_election==10023 & elecdate==8560 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=42.42 if next_election==11787 & elecdate==10023 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=42.3 if next_election==13635 & elecdate==11787 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=34.39 if next_election==15133 & elecdate==13635 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=43.21 if next_election==16561 & elecdate==15133 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=40.67 if next_election==18388 & elecdate==16561 & country_id==17 & partyname=="Lab"

replace voteshare_nextelectiont2=32.36 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Con"
replace voteshare_nextelectiont2=22.05 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Lib"

replace voteshare_nextelectiont2=36.13 if next_election==20978 & elecdate==20215 & country_id==17 & partyname=="Con"

replace voteshare_nextelectiont2=36.88 if next_election==20978+917 & elecdate==20978 & country_id==17 & partyname=="Con"


gen partyvotesharechange=voteshare_nextelection-voteshare_nextelectiont1
gen partyvotesharechanget1=voteshare_nextelectiont1-voteshare_nextelectiont2


** Dataset cleanup: remove excess variables ** 

drop voteshare_nextelection voteshare_nextelectiont1 voteshare_nextelectiont2


** PARTY'S LR, NEXT ELECTION ** 

gen LR_nextelection=.

* AUSTRIA *

replace LR_nextelection=-13.6 if next_election==-3736 & elecdate==-5150 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=32.2 if next_election==-3736 & elecdate==-5150 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-16.5 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=29.5 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=45.9 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="ÖVP"
replace LR_nextelection=-16.9 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=24 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="ÖVP"
replace LR_nextelection=-16 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-13.5 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=11.2 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-15.8 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=5.8 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-6.8 if next_election==3712 & elecdate==2256 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-13.8 if next_election==4300 & elecdate==3712 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-18.9 if next_election==5756 & elecdate==4300 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-5.7 if next_election==7065 & elecdate==5756 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-21.2 if next_election==8514 & elecdate==7065 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-5.9 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="FPÖ"
replace LR_nextelection=-7.1 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-7.6 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=4.8 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=24.59 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="ÖVP"
replace LR_nextelection=-11.06 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=20.85 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=40.42 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-3.61 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="ÖVP"
replace LR_nextelection=-13.35 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="SPÖ"

replace LR_nextelection=-15.7 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="ÖVP"
replace LR_nextelection=-18.03 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="FPÖ"

replace LR_nextelection=-4.31 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="FPÖ"
replace LR_nextelection=-2.96 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-1.15 if next_election==17803 & elecdate==17075 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-38.48 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=-5.51 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=-21.92 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="SPÖ"
replace LR_nextelection=10.16 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="ÖVP"

replace LR_nextelection=2.7 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="FPÖ"
replace LR_nextelection=2.09 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="ÖVP"


* BELGIUM * 
replace LR_nextelection=2.4 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelection=31.8 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="LP-PL"
replace LR_nextelection=-50 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelection=1.6 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelection=21.7 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="LP-PL"

replace LR_nextelection=4.2 if next_election==-2091 & elecdate==-3498 & country_id==2 & partyname=="CVP-PSC"

replace LR_nextelection=4.71 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="LP-PL"
replace LR_nextelection=-19.49 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelection=-9.52 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelection=17.72 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="LP-PL"

replace LR_nextelection=-3.85 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelection=-30.95 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelection=27.7 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="LP-PL"
replace LR_nextelection=0.5 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelection=-17.27 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-22.22 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-25.33 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelection=-11.98 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-5.26 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-11.74 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="MR"
replace LR_nextelection=-39.05 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="PSB-BSP"
replace LR_nextelection=20.37 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="VLD"

replace LR_nextelection=-4.84 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-7.43 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-0.68 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="MR"
replace LR_nextelection=-9.52 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="RW"
replace LR_nextelection=14.4 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="VLD"

replace LR_nextelection=1.3 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CDV"
replace LR_nextelection=5.1 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-0.99 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="FDF"
replace LR_nextelection=15.12 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="VU"

replace LR_nextelection=1.54 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CDV"
replace LR_nextelection=8.54 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-10.53 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="FDF"
replace LR_nextelection=25.27 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="MR"
replace LR_nextelection=-19.86 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="PS"
replace LR_nextelection=-23.36 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="SP"
replace LR_nextelection=36.36 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="VLD"

replace LR_nextelection=14.79 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CDV"
replace LR_nextelection=13.62 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CdH"
replace LR_nextelection=25.15 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="MR"
replace LR_nextelection=15.92 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="VLD"

replace LR_nextelection=6.63 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-6.51 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CdH"
replace LR_nextelection=4.77 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="MR"
replace LR_nextelection=6.92 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="VLD"

replace LR_nextelection=6.63 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-11.21 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-9.6 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="PS"
replace LR_nextelection=-11.22 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="SP"
replace LR_nextelection=-3.86 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="VU"

replace LR_nextelection=-3.17 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-6.1 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-22.99 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="PS"
replace LR_nextelection=-15.63 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="SP"

replace LR_nextelection=-4.18 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-11.93 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-14.87 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="PS"
replace LR_nextelection=-1.43 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="SP"

replace LR_nextelection=-17.34 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="E"
replace LR_nextelection=-21.57 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="G"
replace LR_nextelection=-29.64 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="MR"
replace LR_nextelection=-25.31 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="PS"
replace LR_nextelection=-13.57 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="SP"
replace LR_nextelection=0.37 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="VLD"

replace LR_nextelection=-20.86 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="MR"
replace LR_nextelection=-32.26 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="PS"
replace LR_nextelection=-26.75 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="SP"
replace LR_nextelection=13.49 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="VLD"

replace LR_nextelection=7.25 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-24.55 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-0.2 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="MR"
replace LR_nextelection=-26.69 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="PS"
replace LR_nextelection=12.73 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="VLD"

replace LR_nextelection=-0.1 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-3.86 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CdH"
replace LR_nextelection=-3.86 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="MR"
replace LR_nextelection=-15.5 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="PS"
replace LR_nextelection=-15.5 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="SP"
replace LR_nextelection=-3.86 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="VLD"

replace LR_nextelection=-11.9 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="CDV"
replace LR_nextelection=-8 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="MR"
replace LR_nextelection=4.78 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="N-VA"
replace LR_nextelection=-8 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="VLD"



** DENMARK **

replace LR_nextelection=3.3 if next_election==-4448 & elecdate==-5176 & country_id==3 & partyname=="V"

replace LR_nextelection=-9.2 if next_election==-3405 & elecdate==-4448 & country_id==3 & partyname=="S"

replace LR_nextelection=5.4 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="KF"
replace LR_nextelection=-7.3 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="S"
replace LR_nextelection=5.8 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="V"

replace LR_nextelection=16.7 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="KF"
replace LR_nextelection=14.9 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="V"

replace LR_nextelection=-28.5 if next_election==-962 & elecdate==-2292 & country_id==3 & partyname=="S"

replace LR_nextelection=-6.3 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RF"
replace LR_nextelection=-12 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RV"
replace LR_nextelection=-31.8 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="S"

replace LR_nextelection=-13.2 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="RV"
replace LR_nextelection=-19.7 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="S"

replace LR_nextelection=-4 if next_election==2517 & elecdate==1726 & country_id==3 & partyname=="S"

replace LR_nextelection=-11.5 if next_election==2944 & elecdate==2517 & country_id==3 & partyname=="S"

replace LR_nextelection=39.1 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="KF"
replace LR_nextelection=2.7 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="RV"
replace LR_nextelection=7 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="V"

replace LR_nextelection=1.5 if next_election==5086 & elecdate==4281 & country_id==3 & partyname=="S"

replace LR_nextelection=11.9 if next_election==5487 & elecdate==5086 & country_id==3 & partyname=="V"

replace LR_nextelection=-12.8 if next_election==6255 & elecdate==5487 & country_id==3 & partyname=="S"

replace LR_nextelection=-11.4 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="S" 
replace LR_nextelection=51.1 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="V" 

replace LR_nextelection=-5.7 if next_election==8012 & elecdate==7235 & country_id==3 & partyname=="S"

replace LR_nextelection=34.97 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="CD"
replace LR_nextelection=34.69 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KF"
replace LR_nextelection=11.54 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KrF"
replace LR_nextelection=-23.67 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="S"
replace LR_nextelection=13.66 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="V"

replace LR_nextelection=5.88 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="CD"
replace LR_nextelection=4.49 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KF"
replace LR_nextelection=6.64 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KrF"
replace LR_nextelection=29.23 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="V"

replace LR_nextelection=17.31 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="CD"
replace LR_nextelection=36 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KF"
replace LR_nextelection=15.13 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KrF"
replace LR_nextelection=37.5 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="V"

replace LR_nextelection=10.09 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="KF" 
replace LR_nextelection=-26.79 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="RV" 
replace LR_nextelection=10.06 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="V" 

replace LR_nextelection=2.05 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="CD"
replace LR_nextelection=15.93 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KF"
replace LR_nextelection=9.84 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KrF"
replace LR_nextelection=-7.84 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="RV"
replace LR_nextelection=-7.37 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="S"
replace LR_nextelection=54.07 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="V"

replace LR_nextelection=-14.02 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="CD"
replace LR_nextelection=-5.46 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="RV"
replace LR_nextelection=-1.04 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="S"

replace LR_nextelection=-3.77 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="RV"
replace LR_nextelection=-13.42 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="S"

replace LR_nextelection=9.71 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="KF"
replace LR_nextelection=-2.37 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="V"

replace LR_nextelection=-17.36 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="KF"
replace LR_nextelection=-6.98 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="V"

replace LR_nextelection=47.89 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="KF"
replace LR_nextelection=-13.72 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="V"

replace LR_nextelection=6.25 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="RV"
replace LR_nextelection=-2.09 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="S"
replace LR_nextelection=-64.25 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="SF"

replace LR_nextelection=-7.2 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="KF"
replace LR_nextelection=15.53 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="LA"
replace LR_nextelection=-17.48 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="V"


* FINLAND * 

replace LR_nextelection=-2.33 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="KESK"
replace LR_nextelection=21.28 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="RKP"
replace LR_nextelection=0.98 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SDP"
replace LR_nextelection=12.55 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SKDL"

replace LR_nextelection=2.42 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="KESK"
replace LR_nextelection=21.58 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="LKP"
replace LR_nextelection=10.35 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="RKP"
replace LR_nextelection=9.26 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="SDP"

replace LR_nextelection=37.78 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="KESK"
replace LR_nextelection=1.24 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-38.82 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="SDP"

replace LR_nextelection=10.44 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="KESK" 
replace LR_nextelection=21.58 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="LKP" 
replace LR_nextelection=0.87 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="RKP" 
replace LR_nextelection=-14.92 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="SDP" 
replace LR_nextelection=40.42 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="TPSL" 

replace LR_nextelection=-3.3 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KESK"
replace LR_nextelection=18.18 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KOK"
replace LR_nextelection=21.58 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="LKP"
replace LR_nextelection=7.63 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-25 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="SDP"

replace LR_nextelection=-17.03 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KESK"
replace LR_nextelection=12.81 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KOK"
replace LR_nextelection=21.58 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="LKP"
replace LR_nextelection=-53.66 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="RKP"
replace LR_nextelection=40.52 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="TPSL"

replace LR_nextelection=-15.93 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="KESK"
replace LR_nextelection=-41.1 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-34.36 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-52.23 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SKDL"

replace LR_nextelection=4.25 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="KESK"
replace LR_nextelection=8.22 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="LKP"
replace LR_nextelection=-28.37 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-58 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-12.5 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SKDL"

replace LR_nextelection=-40.24 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="KESK"
replace LR_nextelection=8.22 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="LKP"
replace LR_nextelection=-14.18 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-33.33 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="SDP"

replace LR_nextelection=-24.17 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="KESK"
replace LR_nextelection=-6 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="LKP"
replace LR_nextelection=6.36 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-40.12 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-13.27 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SKDL"

replace LR_nextelection=-36.73 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="KESK"
replace LR_nextelection=6.59 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="RKP"
replace LR_nextelection=43.24 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-64.29 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SKDL"

replace LR_nextelection=-10.55 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="KESK"
replace LR_nextelection=-29.53 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-45.45 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-23.81 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SMP"

replace LR_nextelection=-4.48 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="KOK"
replace LR_nextelection=-7.69 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="RKP"
replace LR_nextelection=1.18 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SDP"
replace LR_nextelection=13.08 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SMP"

replace LR_nextelection=26.84 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KESK"
replace LR_nextelection=14.62 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KOK"
replace LR_nextelection=4.14 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="RKP"
replace LR_nextelection=24.3 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="SKL"

replace LR_nextelection=29.46 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="KOK"
replace LR_nextelection=14.52 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-1.37 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-38.17 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SKDL"
replace LR_nextelection=-6.25 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="VIHR"

replace LR_nextelection=9.76 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="KOK"
replace LR_nextelection=-19.93 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-24.74 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-45.95 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SKDL"
replace LR_nextelection=-33.52 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="VIHR"

replace LR_nextelection=-15.09 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="KESK"
replace LR_nextelection=-25.47 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-36.43 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="SDP"

replace LR_nextelection=-16.38 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KESK"
replace LR_nextelection=13.75 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KOK"
replace LR_nextelection=-23.39 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-27.71 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="VIHR"

replace LR_nextelection=-12.54 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="KOK"
replace LR_nextelection=-20.86 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="RKP"
replace LR_nextelection=-27.02 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SDP"
replace LR_nextelection=-42.78 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKDL"
replace LR_nextelection=4.97 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKL"
replace LR_nextelection=-37.05 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="VIHR"

replace LR_nextelection=-21.69 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KESK"
replace LR_nextelection=1.2 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KOK"
replace LR_nextelection=-13.81 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="SMP"


* GERMANY * 

replace LR_nextelection=-6.61 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="CDU-SCU"
replace LR_nextelection=-15.48 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="DP"
replace LR_nextelection=-1.12 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="FDP"

replace LR_nextelection=50 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="CDU-CSU" 
replace LR_nextelection=-20 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="DP" 
replace LR_nextelection=0 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="FDP" 

replace LR_nextelection=2.33 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="CDU-CSU"

replace LR_nextelection=-1.6 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=0.94 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="FDP"

replace LR_nextelection=-5.08 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=-18.67 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="FDP"
replace LR_nextelection=-10.44 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="SPD"

replace LR_nextelection=26.92 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="FDP"
replace LR_nextelection=-14.44 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="SPD"

replace LR_nextelection=-5.53 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="FDP"
replace LR_nextelection=-20.79 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="SPD"

replace LR_nextelection=-7.13 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="FDP"
replace LR_nextelection=-20.35 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="SPD"

replace LR_nextelection=29.93 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=4 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="FDP"
replace LR_nextelection=-7.17 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="SPD"

replace LR_nextelection=9.89 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=11.22 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="FDP"

replace LR_nextelection=-9.87 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=1.89 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="FDP"

replace LR_nextelection=26.81 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=1.66 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="FDP"

replace LR_nextelection=24.87 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=14.7 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="FDP"

replace LR_nextelection=-13.43 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="GR"
replace LR_nextelection=4.1 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="SPD"

replace LR_nextelection=-10.45 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="GR"
replace LR_nextelection=-2.15 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="SPD"

replace LR_nextelection=8.72 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=-18.3 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="SPD"

replace LR_nextelection=2.56 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=14.04 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="FDP"

replace LR_nextelection=2.76 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=-21.45 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="SPD"

replace LR_nextelection=3.5 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelection=-24.67 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="SPD"


* GREECE * 

replace LR_nextelection=24.42 if next_election==7961 & elecdate==6533 & country_id==7 & partyname=="ND"

replace LR_nextelection=-28.64 if next_election==9284 & elecdate==7961 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=-20.68 if next_election==10761 & elecdate==9284 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=33.96 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="ND"
replace LR_nextelection=5.6 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="SYN"

replace LR_nextelection=29.95 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="ND"
replace LR_nextelection=-29.7 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="PASOK"
replace LR_nextelection=-19.32 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="SYN"

replace LR_nextelection=35.4 if next_election==12336 & elecdate==11055 & country_id==7 & partyname=="ND"

replace LR_nextelection=-13.79 if next_election==13414 & elecdate==12336 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=-17.23 if next_election==14709 & elecdate==13414 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=-9.47 if next_election==16137 & elecdate==14709 & country_id==7 & partyname=="PASOK"    
     
replace LR_nextelection=-12.66 if next_election==17425 & elecdate==16137 & country_id==7 & partyname=="ND"

replace LR_nextelection=-16.26 if next_election==18174 & elecdate==17425 & country_id==7 & partyname=="ND"

replace LR_nextelection=7.02 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="LAOS"
replace LR_nextelection=22.73 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="ND"
replace LR_nextelection=-13.48 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=-8.03 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="ND"
replace LR_nextelection=-37.84 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="PASOK"

replace LR_nextelection=-22.23 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="SYRIZA"
 
 
* ICELAND * 
 
replace LR_nextelection=-9.4 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="IP"
replace LR_nextelection=-36.4 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="SDP"
replace LR_nextelection=-1.7 if next_election==-4933 & elecdate==-5552 & country_id==8 & partyname=="SP"

replace LR_nextelection=42.6 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="IP"
replace LR_nextelection=39.2 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="PP"
replace LR_nextelection=9.8 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SDP"
replace LR_nextelection=-0.7 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SP"

replace LR_nextelection=64.1 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="IP"
replace LR_nextelection=25.4 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="PP"

replace LR_nextelection=14.2 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="IP"
replace LR_nextelection=6.4 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="PP"

replace LR_nextelection=-26.85 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PA"
replace LR_nextelection=61.8 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PP"
replace LR_nextelection=-28.2 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="SDP"

replace LR_nextelection=-14.4 if next_election==-67 & elecdate==-187 & country_id==8 & partyname=="SDP"

replace LR_nextelection=18 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="IP"
replace LR_nextelection=-17.4 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="SDP"

replace LR_nextelection=15.9 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="IP"
replace LR_nextelection=-29.2 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="SDP"

replace LR_nextelection=-1.1 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="IP"
replace LR_nextelection=-9.2 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="SDP"

replace LR_nextelection=-14.05 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PA"
replace LR_nextelection=82.2 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PP"
replace LR_nextelection=-22.2 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="ULL"

replace LR_nextelection=27 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="IP"
replace LR_nextelection=-1.6 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="PP"

replace LR_nextelection=9.05 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PA"
replace LR_nextelection=8.45 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PP"
replace LR_nextelection=-6.2 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="SDP"

replace LR_nextelection=39.8 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="IP"
replace LR_nextelection=29 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PA"
replace LR_nextelection=18.5 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PP"

replace LR_nextelection=28.7 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="IP"
replace LR_nextelection=-10.4 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="PP"

replace LR_nextelection=47.02 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="IP"
replace LR_nextelection=-15.572 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PA"
replace LR_nextelection=42.22 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PP"
replace LR_nextelection=-12.41 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="SDP"

replace LR_nextelection=10.28 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="IP"
replace LR_nextelection=-19.643 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="SDP"

replace LR_nextelection=18.18 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="IP"
replace LR_nextelection=-9.77 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="PP"

replace LR_nextelection=3.8 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="IP"
replace LR_nextelection=-11.56 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="PP"

replace LR_nextelection=3.8 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="IP"
replace LR_nextelection=-15.09 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="PP"

replace LR_nextelection=39.51 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="IP"
replace LR_nextelection=1.39 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="LG"
replace LR_nextelection=-10 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="SDA"

replace LR_nextelection=-32.71 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="LG"
replace LR_nextelection=-11.02 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="SDA"

replace LR_nextelection=9.18 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="IP"
replace LR_nextelection=-6.25 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="PP"

replace LR_nextelection=-14.71 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="BF"
replace LR_nextelection=-0.63 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="IP"
replace LR_nextelection=-11.231 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="RP"


* IRELAND *  
 
replace LR_nextelection=-11.6 if next_election==-4349 & elecdate==-5694 & country_id==9 & partyname=="FF"

replace LR_nextelection=-3.92 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnP"
replace LR_nextelection=-3.33 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnT"
replace LR_nextelection=33.9 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="FG"
replace LR_nextelection=-42 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="Lab"

replace LR_nextelection=19.8 if next_election==-2054 & elecdate==-3138 & country_id==9 & partyname=="FF"

replace LR_nextelection=0 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="CnT"
replace LR_nextelection=78.4 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="FG"
replace LR_nextelection=-31.9 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="Lab"

replace LR_nextelection=33.3 if next_election==642 & elecdate==-1032 & country_id==9 & partyname=="FF"

replace LR_nextelection=-0.5 if next_election==1923 & elecdate==642 & country_id==9 & partyname=="FF"

replace LR_nextelection=34.5 if next_election==3456 & elecdate==1923 & country_id==9 & partyname=="FF"

replace LR_nextelection=57.1 if next_election==4807 & elecdate==3456 & country_id==9 & partyname=="FF"

replace LR_nextelection=-16 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="FG"
replace LR_nextelection=-16 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="Lab"

replace LR_nextelection=-1.4 if next_election==7832 & elecdate==6376 & country_id==9 & partyname=="FF"

replace LR_nextelection=14.11 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="FG"
replace LR_nextelection=-20.69 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="Lab"

replace LR_nextelection=-30.19 if next_election==8363 & elecdate==8084 & country_id==9 & partyname=="FF"

replace LR_nextelection=-12.75 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="FG"
replace LR_nextelection=-21.31 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="Lab"

replace LR_nextelection=-8.42 if next_election==10758 & elecdate==9909 & country_id==9 & partyname=="FF"

replace LR_nextelection=-3.41 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="FF"
replace LR_nextelection=19.28 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="PD"

replace LR_nextelection=4.8 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FF"
replace LR_nextelection=8.94 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FG"
replace LR_nextelection=-5.95 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="Lab"
replace LR_nextelection=-12.31 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="WP-DL"

replace LR_nextelection=-6.25 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="FF"
replace LR_nextelection=-9.98 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="PD"

replace LR_nextelection=-9.76 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="FF"
replace LR_nextelection=-6.86 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="PD"

replace LR_nextelection=2.91 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="FF"
replace LR_nextelection=-14.88 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="GR"

replace LR_nextelection=-18.11 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="FG"
replace LR_nextelection=-27.8 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="Lab"


* Italy *

replace LR_nextelection=7.143 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="DC"
replace LR_nextelection=-11.43 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PCI-PDS-DS"
replace LR_nextelection=45 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PLI"
replace LR_nextelection=-22.41 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-13.79 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PSI"

replace LR_nextelection=-12.77 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="DC"
replace LR_nextelection=-0.46 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PLI"
replace LR_nextelection=-20.86 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-25 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PSDI"

replace LR_nextelection=-9.65 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="DC"
replace LR_nextelection=19.15 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PLI"
replace LR_nextelection=-24.07 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PSDI"

replace LR_nextelection=-5.86 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="DC"
replace LR_nextelection=-21.44 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-29.51 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PSDI"

replace LR_nextelection=-10.79 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="DC"
replace LR_nextelection=1.54 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-18.7 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=-18.7 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSI"

replace LR_nextelection=3.57 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="DC"
replace LR_nextelection=-3.96 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-11.45 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=-40.17 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSI"

replace LR_nextelection=3.17 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="DC"
replace LR_nextelection=-0.46 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PLI"
replace LR_nextelection=3.72 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-6.93 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=-10.4 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSI"

replace LR_nextelection=-6.29 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="DC"
replace LR_nextelection=-2.78 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PRI"
replace LR_nextelection=2.49 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PSDI"

replace LR_nextelection=-2.62 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="DC"
replace LR_nextelection=3.55 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PLI"
replace LR_nextelection=-0.2 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PRI"
replace LR_nextelection=-11.31 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=-6.75 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSI"

replace LR_nextelection=4.25 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="DC"
replace LR_nextelection=30.37 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PLI"
replace LR_nextelection=45.76 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PRI"
replace LR_nextelection=18.28 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=4.24 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSI"

replace LR_nextelection=8.78 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="DC"
replace LR_nextelection=10.56 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PLI"
replace LR_nextelection=36.73 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PRI"
replace LR_nextelection=2.33 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSDI"
replace LR_nextelection=8.02 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSI"

replace LR_nextelection=47.34 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="DC"
replace LR_nextelection=8.02 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSI"

replace LR_nextelection=6.63 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="AN"
replace LR_nextelection=35.19 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="CCD-CDU-UDC"
replace LR_nextelection=59.26 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelection=17.47 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="LN"

replace LR_nextelection=-7.58 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PCI-PDS-DS"
replace LR_nextelection=-7.58 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PdCI"
replace LR_nextelection=-8.805 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="UDR-UDEUR"

replace LR_nextelection=48.19 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="AN"
replace LR_nextelection=48.19 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelection=48.19 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="LN"
replace LR_nextelection=48.19 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="NPSI"

replace LR_nextelection=9.3 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="IdV"
replace LR_nextelection=-7.58 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="PD"
replace LR_nextelection=13.889 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="UDR-UDEUR"

replace LR_nextelection=3.81 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelection=3.81 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="LN"

replace LR_nextelection=15.62 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelection=-8.28 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="PD"

* The Netherlands *

replace LR_nextelection=6.5 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-14.8 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=23.75 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="CHU"
replace LR_nextelection=19.7 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-22.6 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="PvdA"
replace LR_nextelection=32.6 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="VVD"

replace LR_nextelection=8.5 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="ARP"
replace LR_nextelection=26.9 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="CHU"
replace LR_nextelection=8.6 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-21 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=16.9 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="ARP"
replace LR_nextelection=14 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="CHU"
replace LR_nextelection=-9.1 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-28.2 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=2.4 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="ARP"
replace LR_nextelection=-2.4 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="CHU"
replace LR_nextelection=-13.3 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="KVP"
replace LR_nextelection=9.7 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-5.5 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="ARP"
replace LR_nextelection=10.4 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="CHU"
replace LR_nextelection=7.2 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-24.6 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="PvdA"
replace LR_nextelection=10.3 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-18.1 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="ARP"
replace LR_nextelection=-21.4 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="CHU"
replace LR_nextelection=-26.2 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="KVP"
replace LR_nextelection=-1.8 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-14 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="ARP"
replace LR_nextelection=-14 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="CHU"
replace LR_nextelection=-12.9 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="DS70"
replace LR_nextelection=-14 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="KVP"
replace LR_nextelection=21.3 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-26.6 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="D66"
replace LR_nextelection=-42.4 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PPR"
replace LR_nextelection=-45.6 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=-19.3 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="CDA"
replace LR_nextelection=7.6 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-11.7 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="CDA"
replace LR_nextelection=-12.6 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="D66"
replace LR_nextelection=-20.7 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=-4 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="CDA"
replace LR_nextelection=6.6 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-8.8 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="CDA"
replace LR_nextelection=4.5 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-2.59 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="CDA"
replace LR_nextelection=4.26 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=-17.77 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="D66"
replace LR_nextelection=-22.07 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="PvdA"
replace LR_nextelection=7.24 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-8.83 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="D66"
replace LR_nextelection=-7.58 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="PvdA"
replace LR_nextelection=18.92 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="VVD"

replace LR_nextelection=2.47 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="CDA"
replace LR_nextelection=3.23 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="LPF"
replace LR_nextelection=28.08 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="VVD"

replace LR_nextelection=4 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="CDA"
replace LR_nextelection=-1.33 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="D66"
replace LR_nextelection=20.81 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="VVD"

replace LR_nextelection=9.58 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CDA"
replace LR_nextelection=18.88 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CU"
replace LR_nextelection=0.65 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="PvdA"

replace LR_nextelection=17.7 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="CDA"
replace LR_nextelection=22.63 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="VVD"

replace LR_nextelection=-13.84 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="PvdA"
replace LR_nextelection=10.95 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="VVD"


* NORWAY *

replace LR_nextelection=-36.6 if next_election==-3735 & elecdate==-5198 & country_id==13 & partyname=="A"

replace LR_nextelection=-31.2 if next_election==-2272 & elecdate==-3735 & country_id==13 & partyname=="A"

replace LR_nextelection=-32. if next_election==-816 & elecdate==-2272 & country_id==13 & partyname=="A"

replace LR_nextelection=-27.1 if next_election==619 & elecdate==-816 & country_id==13 & partyname=="A"

replace LR_nextelection=-39.2 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="A"
replace LR_nextelection=-4.2 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="H"
replace LR_nextelection=-3.3 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-15.1 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="SP"
replace LR_nextelection=-34.3 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="V"

replace LR_nextelection=-1.4 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="H"
replace LR_nextelection=-18.5 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-17.4 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="SP"
replace LR_nextelection=-30.9 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="V"

replace LR_nextelection=-36.6 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="A"
replace LR_nextelection=-18.1 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="H"
replace LR_nextelection=-5 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-14.5 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="SP"
replace LR_nextelection=-30.1 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="V"

replace LR_nextelection=-31.6 if next_election==6464 & elecdate==5001 & country_id==13 & partyname=="A"

replace LR_nextelection=-22.7 if next_election==7927 & elecdate==6464 & country_id==13 & partyname=="A"

replace LR_nextelection=-7.9 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="H"
replace LR_nextelection=-12.1 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-12.4 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="SP"

replace LR_nextelection=-36 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="A"
replace LR_nextelection=-7.1 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="H"
replace LR_nextelection=-21.4 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-19.9 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="SP"

replace LR_nextelection=-19.71 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="A"
replace LR_nextelection=14.39 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="H"
replace LR_nextelection=2.04 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-15.64 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="SP"

replace LR_nextelection=-18.11 if next_election==13772 & elecdate==12309 & country_id==13 & partyname=="A"

replace LR_nextelection=-38.18 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="A"
replace LR_nextelection=-18.57 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-27.27 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="SP"
replace LR_nextelection=-15.5 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="V"

replace LR_nextelection=13.38 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="H"
replace LR_nextelection=-24.32 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="KRF"
replace LR_nextelection=-23.8 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="V"

replace LR_nextelection=-29.79 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="A"
replace LR_nextelection=-40.11 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SF-SV"
replace LR_nextelection=-20.41 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SP"

replace LR_nextelection=-17.9 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="A"
replace LR_nextelection=-28.25 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SF-SV"
replace LR_nextelection=-17.52 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SP"

replace LR_nextelection=14.16 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="FRP"
replace LR_nextelection=-7.81 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="H"

 
* PORTUGAL *
 
replace LR_nextelection=9.42 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=6.61 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="PS"

replace LR_nextelection=19.43 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=19.43 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PPM"
replace LR_nextelection=19.43 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PSD"

replace LR_nextelection=38.39 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=9.6 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PPM"
replace LR_nextelection=-20.97 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PSD"

replace LR_nextelection=17.81 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PS"
replace LR_nextelection=26.09 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PSD"

replace LR_nextelection=25.73 if next_election==10061 & elecdate==9410 & country_id==14 & partyname=="PSD"

replace LR_nextelection=-8.77 if next_election==11601 & elecdate==10061 & country_id==14 & partyname=="PSD"

replace LR_nextelection=-4.16 if next_election==13057 & elecdate==11601 & country_id==14 & partyname=="PSD"

replace LR_nextelection=-17.7 if next_election==14527 & elecdate==13057 & country_id==14 & partyname=="PS"

replace LR_nextelection=-9.9 if next_election==15416 & elecdate==14527 & country_id==14 & partyname=="PS"

replace LR_nextelection=9.61 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=2.02 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="PSD"

replace LR_nextelection=-4.5 if next_election==18167 & elecdate==16487 & country_id==14 & partyname=="PS"

replace LR_nextelection=0.24 if next_election==18783 & elecdate==18167 & country_id==14 & partyname=="PS"

replace LR_nextelection=0.6 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=0.6 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="PSD"

replace LR_nextelection=10.77 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelection=-12.62 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PS"
replace LR_nextelection=-4.6 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PSD"

* SPAIN *
 
replace LR_nextelection=0.47 if next_election==6999 & elecdate==6375 & country_id==15 & partyname=="UCD"

replace LR_nextelection=-7.21 if next_election==8336 & elecdate==6999 & country_id==15 & partyname=="UCD"

replace LR_nextelection=-11.65 if next_election==9669 & elecdate==8336 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=-22.31 if next_election==10894 & elecdate==9669 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=-23.21 if next_election==12210 & elecdate==10894 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=-4.11 if next_election==13211 & elecdate==12210 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=3.59 if next_election==14681 & elecdate==13211 & country_id==15 & partyname=="PP"

replace LR_nextelection=9.31 if next_election==16144 & elecdate==14681 & country_id==15 & partyname=="PP"

replace LR_nextelection=-22.9 if next_election==17600 & elecdate==16144 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=-27.23 if next_election==18951 & elecdate==17600 & country_id==15 & partyname=="PSOE"

replace LR_nextelection=-4.25 if next_election==20442 & elecdate==18951 & country_id==15 & partyname=="PP"

replace LR_nextelection=-4.25 if next_election==20631 & elecdate==20442 & country_id==15 & partyname=="PP"

replace LR_nextelection=6.06 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PP"
replace LR_nextelection=-29.27 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PSOE"

* SWEDEN *

replace LR_nextelection=-33.4 if next_election==-4121 & elecdate==-5584 & country_id==16 & partyname=="S"

replace LR_nextelection=1.2 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="C"
replace LR_nextelection=-28.3 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="S"

replace LR_nextelection=1.8 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="C" 
replace LR_nextelection=-44.2 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="S" 

replace LR_nextelection=11.9 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="C"
replace LR_nextelection=-24.7 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="S"

replace LR_nextelection=-61.4 if next_election==261 & elecdate==-579 & country_id==16 & partyname=="S"
replace LR_nextelection=-33.6 if next_election==1724 & elecdate==261 & country_id==16 & partyname=="S"
replace LR_nextelection=-42.9 if next_election==3180 & elecdate==1724 & country_id==16 & partyname=="S"
replace LR_nextelection=-41.2 if next_election==3915 & elecdate==3180 & country_id==16 & partyname=="S"
replace LR_nextelection=-7.7 if next_election==5007 & elecdate==3915 & country_id==16 & partyname=="S"
replace LR_nextelection=-11.5 if next_election==6106 & elecdate==5007 & country_id==16 & partyname=="S"

replace LR_nextelection=-8.1 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="C"
replace LR_nextelection=-15.2 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="L"
replace LR_nextelection=23.1 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="M"

replace LR_nextelection=-14 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="C"
replace LR_nextelection=4.8 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="L"
replace LR_nextelection=25.1 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="M"


replace LR_nextelection=-21.1 if next_election==9389 & elecdate==8297 & country_id==16 & partyname=="S"
replace LR_nextelection=-23.9 if next_election==10488 & elecdate==9389 & country_id==16 & partyname=="S"
replace LR_nextelection=-6.15 if next_election==11580 & elecdate==10488 & country_id==16 & partyname=="S"

replace LR_nextelection=21.82 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="C"
replace LR_nextelection=13.95 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="KD"
replace LR_nextelection=19.27 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="L"
replace LR_nextelection=40.2 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="M"


replace LR_nextelection=-3.52 if next_election==14142 & elecdate==12679 & country_id==16 & partyname=="S"
replace LR_nextelection=-18.32 if next_election==15598 & elecdate==14142 & country_id==16 & partyname=="S"
replace LR_nextelection=-24.17 if next_election==17061 & elecdate==15598 & country_id==16 & partyname=="S"

replace LR_nextelection=-2.24 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="C"
replace LR_nextelection=8.14 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="KD"
replace LR_nextelection=-4.8 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="L"
replace LR_nextelection=2.48 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="M"

replace LR_nextelection=7.89 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="C"
replace LR_nextelection=4.88 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="KD"
replace LR_nextelection=-2.52 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="L"
replace LR_nextelection=-16.77 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="M"

replace LR_nextelection=-15.966 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="MP"
replace LR_nextelection=-20 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="S"

* UK *

replace LR_nextelection=-28.1 if next_election==-3599 & elecdate==-5293 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-35.2 if next_election==-2990 & elecdate==-3599 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-30.6 if next_election==-1681 & elecdate==-2990 & country_id==17 & partyname=="Con"

replace LR_nextelection=-23.3 if next_election==-85 & elecdate==-1681 & country_id==17 & partyname=="Con"

replace LR_nextelection=-7.8 if next_election==1749 & elecdate==-85 & country_id==17 & partyname=="Con"

replace LR_nextelection=-14.8 if next_election==2281 & elecdate==1749 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-10.3 if next_election==3821 & elecdate==2281 & country_id==17 & partyname=="Lab"

replace LR_nextelection=0 if next_election==5172 & elecdate==3821 & country_id==17 & partyname=="Con"

replace LR_nextelection=-27.5 if next_election==5396 & elecdate==5172 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-26.6 if next_election==7062 & elecdate==5396 & country_id==17 & partyname=="Lab"

replace LR_nextelection=29 if next_election==8560 & elecdate==7062 & country_id==17 & partyname=="Con"

replace LR_nextelection=30.47 if next_election==10023 & elecdate==8560 & country_id==17 & partyname=="Con"

replace LR_nextelection=27.8 if next_election==11787 & elecdate==10023 & country_id==17 & partyname=="Con"

replace LR_nextelection=25.74 if next_election==13635 & elecdate==11787 & country_id==17 & partyname=="Con"

replace LR_nextelection=1.47 if next_election==15133 & elecdate==13635 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-3.09 if next_election==16561 & elecdate==15133 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-1.5 if next_election==18388 & elecdate==16561 & country_id==17 & partyname=="Lab"

replace LR_nextelection=-1.57 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Con"
replace LR_nextelection=-16.07 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Lib"

replace LR_nextelection=-2.61 if next_election==20978 & elecdate==20215 & country_id==17 & partyname=="Con"

replace LR_nextelection=6.21 if next_election==20978+917 & elecdate==20978 & country_id==17 & partyname=="Con"


** PARTY'S LR, PREVIOUS ELECTION ** 

gen LR_nextelectiont1=.

* AUSTRIA *

replace LR_nextelectiont1=-13.6 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=32.2 if next_election==-2504 & elecdate==-3736 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=29.5 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="ÖVP"
replace LR_nextelectiont1=-16.5 if next_election==-1328 & elecdate==-2504 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=45.9 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="ÖVP"
replace LR_nextelectiont1=-16.9 if next_election==-236 & elecdate==-1328 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-16 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=24 if next_election==1052 & elecdate==-236 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=-13.5 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=11.2 if next_election==2256 & elecdate==1052 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=5.8 if next_election==3712 & elecdate==2256 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=-54.3 if next_election==4300 & elecdate==3712 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-13.8 if next_election==5756 & elecdate==4300 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-18.9 if next_election==7065 & elecdate==5756 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-5.7 if next_election==8514 & elecdate==7065 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=15.1 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="FPÖ"
replace LR_nextelectiont1=-21.2 if next_election==9823 & elecdate==8514 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-7.1 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=29.1 if next_election==11237 & elecdate==9823 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=4.8 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="ÖVP"
replace LR_nextelectiont1=-7.6 if next_election==12700 & elecdate==11237 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-11.06 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=24.59 if next_election==13134 & elecdate==12700 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=40.42 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="ÖVP"
replace LR_nextelectiont1=20.85 if next_election==14520 & elecdate==13134 & country_id==1 & partyname=="SPÖ"

replace LR_nextelectiont1=-3.61 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="ÖVP"
replace LR_nextelectiont1=24.639 if next_election==15668 & elecdate==14520 & country_id==1 & partyname=="FPÖ"

replace LR_nextelectiont1=-18.03 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="FPÖ"
replace LR_nextelectiont1=-15.7 if next_election==17075 & elecdate==15668 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=-2.96 if next_election==17803 & elecdate==17075 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=-17.87 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=-1.15 if next_election==19630 & elecdate==17803 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=-38.48 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="SPÖ"
replace LR_nextelectiont1=-5.51 if next_election==21107 & elecdate==19630 & country_id==1 & partyname=="ÖVP"

replace LR_nextelectiont1=9.29 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="FPÖ"
replace LR_nextelectiont1=10.16 if next_election==21107+714 & elecdate==21107 & country_id==1 & partyname=="ÖVP"


* BELGIUM * 
replace LR_nextelectiont1=30.1 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelectiont1=15.3 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="LP-PL"
replace LR_nextelectiont1=-13.5 if next_election==-3841 & elecdate==-5066 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelectiont1=2.4 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelectiont1=31.8 if next_election==-3498 & elecdate==-3841 & country_id==2 & partyname=="LP-PL"

replace LR_nextelectiont1=1.6 if next_election==-2091 & elecdate==-3498 & country_id==2 & partyname=="CVP-PSC"

replace LR_nextelectiont1=38.8 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="LP-PL"
replace LR_nextelectiont1=-31 if next_election==-579 & elecdate==-2091 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelectiont1=-3.81 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelectiont1=4.71 if next_election==450 & elecdate==-579 & country_id==2 & partyname=="LP-PL"

replace LR_nextelectiont1=-9.52 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelectiont1=-19.53 if next_election==1969 & elecdate==450 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelectiont1=-3.85 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="CVP-PSC"
replace LR_nextelectiont1=8.31 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="LP-PL"
replace LR_nextelectiont1=-30.95 if next_election==3012 & elecdate==1969 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelectiont1=-12.81 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-13.17 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=0.5 if next_election==4328 & elecdate==3012 & country_id==2 & partyname=="PSB-BSP"

replace LR_nextelectiont1=-17.27 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-22.22 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=3.41 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-25.33 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="PSB-BSP"
replace LR_nextelectiont1=-3.1 if next_election==5182 & elecdate==4328 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=-11.98 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-5.26 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-11.74 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-9.16 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="RW"
replace LR_nextelectiont1=20.37 if next_election==6316 & elecdate==5182 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=-4.84 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-7.43 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-0.68 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="FDF"
replace LR_nextelectiont1=-26.07 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="PSB-BSP"
replace LR_nextelectiont1=-6.36 if next_election==6925 & elecdate==6316 & country_id==2 & partyname=="VU"

replace LR_nextelectiont1=1.3 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=5.1 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-0.99 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="FDF"
replace LR_nextelectiont1=3.29 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=0.51 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-29.46 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="SP"
replace LR_nextelectiont1=26.18 if next_election==7982 & elecdate==6925 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=1.54 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=8.54 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-10.53 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=36.36 if next_election==9417 & elecdate==7982 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=14.79 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=13.62 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=25.15 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=15.92 if next_election==10208 & elecdate==9417 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=6.63 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-6.51 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-13.68 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-28 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="SP"
replace LR_nextelectiont1=-2.88 if next_election==11650 & elecdate==10208 & country_id==2 & partyname=="VU"

replace LR_nextelectiont1=6.63 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-11.21 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-9.6 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-11.22 if next_election==12924 & elecdate==11650 & country_id==2 & partyname=="SP"

replace LR_nextelectiont1=-3.17 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-6.1 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-22.99 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-15.63 if next_election==14408 & elecdate==12924 & country_id==2 & partyname=="SP"


replace LR_nextelectiont1=-19.76 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="E"
replace LR_nextelectiont1=-16.68 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="G"
replace LR_nextelectiont1=-7.8 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-14.87 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-1.43 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="SP"
replace LR_nextelectiont1=5.56 if next_election==15843 & elecdate==14408 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=-29.64 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-25.31 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-13.57 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="SP"
replace LR_nextelectiont1=0.37 if next_election==17327 & elecdate==15843 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=11.39 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-26.77 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-20.86 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-32.26 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=13.49 if next_election==18426 & elecdate==17327 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=7.25 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-24.55 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="CdH"
replace LR_nextelectiont1=-0.2 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=-26.69 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="PS"
replace LR_nextelectiont1=-12.61 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="SP"
replace LR_nextelectiont1=12.73 if next_election==19868 & elecdate==18426 & country_id==2 & partyname=="VLD"

replace LR_nextelectiont1=-0.1 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="CDV"
replace LR_nextelectiont1=-3.86 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="MR"
replace LR_nextelectiont1=8.58 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="N-VA"
replace LR_nextelectiont1=-3.86 if next_election==19868+1827 & elecdate==19868 & country_id==2 & partyname=="VLD"



** DENMARK **

replace LR_nextelectiont1=16.4 if next_election==-4448 & elecdate==-5176 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-10.8 if next_election==-3405 & elecdate==-4448 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=38.2 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=-9.2 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="S"
replace LR_nextelectiont1=20 if next_election==-2446 & elecdate==-3405 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=5.4 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=5.8 if next_election==-2292 & elecdate==-2446 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-6.8 if next_election==-962 & elecdate==-2292 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=15.9 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RF"
replace LR_nextelectiont1=0.1 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-28.5 if next_election==319 & elecdate==-962 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=-12 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-31.8 if next_election==1726 & elecdate==319 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=-19.7 if next_election==2517 & elecdate==1726 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=-4 if next_election==2944 & elecdate==2517 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=15 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=-12.8 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=8.7 if next_election==4281 & elecdate==2944 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-35.7 if next_election==5086 & elecdate==4281 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=37.9 if next_election==5487 & elecdate==5086 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-9.5 if next_election==6255 & elecdate==5487 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=-12.8 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="S" 
replace LR_nextelectiont1=20.5 if next_election==7235 & elecdate==6255 & country_id==3 & partyname=="V" 

replace LR_nextelectiont1=-11.4 if next_election==8012 & elecdate==7235 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=42.1 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="CD"
replace LR_nextelectiont1=51.7 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=15.4 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="KrF"
replace LR_nextelectiont1=-5.7 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="S"
replace LR_nextelectiont1=23.5 if next_election==8775 & elecdate==8012 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=34.97 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="CD"
replace LR_nextelectiont1=34.69 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=11.54 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="KrF"
replace LR_nextelectiont1=13.66 if next_election==10112 & elecdate==8775 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=5.88 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="CD"
replace LR_nextelectiont1=4.49 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=6.64 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="KrF"
replace LR_nextelectiont1=29.23 if next_election==10357 & elecdate==10112 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=36 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="KF" 
replace LR_nextelectiont1=-13.04 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="RV" 
replace LR_nextelectiont1=37.5 if next_election==11303 & elecdate==10357 & country_id==3 & partyname=="V" 

replace LR_nextelectiont1=10 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="CD"
replace LR_nextelectiont1=10.09 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=14.81 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="KrF"
replace LR_nextelectiont1=-26.79 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-35.48 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="S"
replace LR_nextelectiont1=10.06 if next_election==12682 & elecdate==11303 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=2.05 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="CD"
replace LR_nextelectiont1=-7.84 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-7.37 if next_election==13949 & elecdate==12682 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=-5.46 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-1.04 if next_election==15299 & elecdate==13949 & country_id==3 & partyname=="S"

replace LR_nextelectiont1=20.37 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=36.23 if next_election==16475 & elecdate==15299 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=9.71 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=-2.37 if next_election==17483 & elecdate==16475 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-17.36 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=-6.98 if next_election==18885 & elecdate==17483 & country_id==3 & partyname=="V"

replace LR_nextelectiont1=-0.79 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="RV"
replace LR_nextelectiont1=-6.51 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="S"
replace LR_nextelectiont1=-45.42 if next_election==20257 & elecdate==18885 & country_id==3 & partyname=="SF"

replace LR_nextelectiont1=60 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="KF"
replace LR_nextelectiont1=28.7 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="LA"
replace LR_nextelectiont1=17.82 if next_election==20257+1448 & elecdate==20257 & country_id==3 & partyname=="V"


* FINLAND * 

replace LR_nextelectiont1=3.3 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=4.17 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=78.95 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-42.93 if next_election==-4200 & elecdate==-5402 & country_id==4 & partyname=="SKDL"

replace LR_nextelectiont1=-2.33 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=21.28 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=0.98 if next_election==-3104 & elecdate==-4200 & country_id==4 & partyname=="SDP"

replace LR_nextelectiont1=2.42 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=10.35 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=9.26 if next_election==-2125 & elecdate==-3104 & country_id==4 & partyname=="SDP"

replace LR_nextelectiont1=37.78 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="KESK" 
replace LR_nextelectiont1=21.58 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="LKP" 
replace LR_nextelectiont1=1.24 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="RKP" 
replace LR_nextelectiont1=-38.82 if next_election==-543 & elecdate==-2125 & country_id==4 & partyname=="SDP" 

replace LR_nextelectiont1=10.44 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-44 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=21.58 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=0.87 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-14.92 if next_election==766 & elecdate==-543 & country_id==4 & partyname=="SDP"

replace LR_nextelectiont1=-3.3 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=18.18 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=21.58 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=7.63 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=40.52 if next_election==2271 & elecdate==766 & country_id==4 & partyname=="TPSL"

replace LR_nextelectiont1=-17.03 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-53.66 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-10.71 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-50 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="SKDL"
replace LR_nextelectiont1=40.52 if next_election==3727 & elecdate==2271 & country_id==4 & partyname=="TPSL"

replace LR_nextelectiont1=-15.93 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=30.07 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=-41.01 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-34.36 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-52.23 if next_election==4385 & elecdate==3727 & country_id==4 & partyname=="SKDL"

replace LR_nextelectiont1=4.25 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=8.22 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=-28.37 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-58 if next_election==5743 & elecdate==4385 & country_id==4 & partyname=="SDP"

replace LR_nextelectiont1=-40.24 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=8.22 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=-14.18 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-33.33 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-42.55 if next_election==7017 & elecdate==5743 & country_id==4 & partyname=="SKDL"

replace LR_nextelectiont1=-24.17 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-6 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="LKP"
replace LR_nextelectiont1=6.36 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-40.12 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-13.27 if next_election==8480 & elecdate==7017 & country_id==4 & partyname=="SKDL"

replace LR_nextelectiont1=-36.73 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=6.59 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=43.24 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-9.09 if next_election==9936 & elecdate==8480 & country_id==4 & partyname=="SMP"

replace LR_nextelectiont1=-30.5 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=-29.53 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-45.45 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-23.81 if next_election==11398 & elecdate==9936 & country_id==4 & partyname=="SMP"

replace LR_nextelectiont1=1.27 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-4.48 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=-7.69 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=5 if next_election==12861 & elecdate==11398 & country_id==4 & partyname=="SKL"

replace LR_nextelectiont1=14.62 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=4.14 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-13.72 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-14.89 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="SKDL"
replace LR_nextelectiont1=-13.43 if next_election==14324 & elecdate==12861 & country_id==4 & partyname=="VIHR"

replace LR_nextelectiont1=29.46 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=14.52 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-1.37 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-38.17 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="SKDL"
replace LR_nextelectiont1=-6.25 if next_election==15780 & elecdate==14324 & country_id==4 & partyname=="VIHR"

replace LR_nextelectiont1=-7.64 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-19.93 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-24.74 if next_election==17243 & elecdate==15780 & country_id==4 & partyname=="SDP"

replace LR_nextelectiont1=-15.09 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-20.56 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=-25.47 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-21.47 if next_election==18734 & elecdate==17243 & country_id==4 & partyname=="VIHR"

replace LR_nextelectiont1=13.75 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=-23.39 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="RKP"
replace LR_nextelectiont1=-11.38 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SDP"
replace LR_nextelectiont1=-44.77 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKDL"
replace LR_nextelectiont1=-16.77 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="SKL"
replace LR_nextelectiont1=-27.71 if next_election==20197 & elecdate==18734 & country_id==4 & partyname=="VIHR"

replace LR_nextelectiont1=-4.35 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KESK"
replace LR_nextelectiont1=-12.54 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="KOK"
replace LR_nextelectiont1=-4.94 if next_election==20197+1456 & elecdate==20197 & country_id==4 & partyname=="SMP"


* GERMANY * 

replace LR_nextelectiont1=-11.56 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=28.57 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="DP"
replace LR_nextelectiont1=6.54 if next_election==-2308 & elecdate==-3792 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=-6.61 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="CDU-CSU" 
replace LR_nextelectiont1=-15.48 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="DP" 
replace LR_nextelectiont1=-1.12 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="FDP" 
replace LR_nextelectiont1=-13.33 if next_election==-838 & elecdate==-2308 & country_id==6 & partyname=="GB-BHE" 

replace LR_nextelectiont1=50 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-20 if next_election==625 & elecdate==-838 & country_id==6 & partyname=="DP"

replace LR_nextelectiont1=2.33 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-17.76 if next_election==2088 & elecdate==625 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=-1.6 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=0.94 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="FDP"
replace LR_nextelectiont1=-5.92 if next_election==3558 & elecdate==2088 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=-18.67 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="FDP"
replace LR_nextelectiont1=-10.44 if next_election==4706 & elecdate==3558 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=26.92 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="FDP"
replace LR_nextelectiont1=-14.44 if next_election==6120 & elecdate==4706 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=-5.53 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="FDP"
replace LR_nextelectiont1=-20.79 if next_election==7583 & elecdate==6120 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=21.21 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-7.13 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="FDP"
replace LR_nextelectiont1=-20.35 if next_election==8465 & elecdate==7583 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=29.93 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=4 if next_election==9886 & elecdate==8465 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=9.89 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=11.22 if next_election==11293 & elecdate==9886 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=-9.87 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=1.89 if next_election==12707 & elecdate==11293 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=26.81 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=1.66 if next_election==14149 & elecdate==12707 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=-16.26 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="GR"
replace LR_nextelectiont1=-1.6 if next_election==15605 & elecdate==14149 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=-13.43 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="GR"
replace LR_nextelectiont1=4.1 if next_election==16697 & elecdate==15605 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=25.61 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-2.15 if next_election==18167 & elecdate==16697 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=8.72 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=4.27 if next_election==19623 & elecdate==18167 & country_id==6 & partyname=="FDP"

replace LR_nextelectiont1=2.56 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-23.57 if next_election==21086 & elecdate==19623 & country_id==6 & partyname=="SPD"

replace LR_nextelectiont1=2.76 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="CDU-CSU"
replace LR_nextelectiont1=-21.45 if next_election==21086+1463 & elecdate==21086 & country_id==6 & partyname=="SPD"


* GREECE * 

replace LR_nextelectiont1=32.3 if next_election==7961 & elecdate==6533 & country_id==7 & partyname=="ND"

replace LR_nextelectiont1=-27.11 if next_election==9284 & elecdate==7961 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=-28.64 if next_election==10761 & elecdate==9284 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=37.98 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="ND"
replace LR_nextelectiont1=-27.68 if next_election==10901 & elecdate==10761 & country_id==7 & partyname=="SYN"

replace LR_nextelectiont1=33.96 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="ND"
replace LR_nextelectiont1=-8.63 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="PASOK"
replace LR_nextelectiont1=5.6 if next_election==11055 & elecdate==10901 & country_id==7 & partyname=="SYN"

replace LR_nextelectiont1=29.95 if next_election==12336 & elecdate==11055 & country_id==7 & partyname=="ND"

replace LR_nextelectiont1=-18.76 if next_election==13414 & elecdate==12336 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=-13.79 if next_election==14709 & elecdate==13414 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=-17.23 if next_election==16137 & elecdate==14709 & country_id==7 & partyname=="PASOK"    
     
replace LR_nextelectiont1=-17.6 if next_election==17425 & elecdate==16137 & country_id==7 & partyname=="ND"

replace LR_nextelectiont1=-12.66 if next_election==18174 & elecdate==17425 & country_id==7 & partyname=="ND"

replace LR_nextelectiont1=-16.26 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="ND"
replace LR_nextelectiont1=-20.73 if next_election==19119 & elecdate==18174 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=-6.71 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="DIMAR"
replace LR_nextelectiont1=22.73 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="ND"
replace LR_nextelectiont1=26.53 if next_election==20113 & elecdate==19161 & country_id==7 & partyname=="PASOK"

replace LR_nextelectiont1=46.15 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="ANEL"
replace LR_nextelectiont1=-41.72 if next_election==20351 & elecdate==20113 & country_id==7 & partyname=="SYRIZA"

replace LR_nextelectiont1=-22.23 if next_election==20351+1386 & elecdate==20351 & country_id==7 & partyname=="SYRIZA"
 
 
* ICELAND * 
 
replace LR_nextelectiont1=-9.4 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=57.8 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="PP"
replace LR_nextelectiont1=-36.4 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SDP"
replace LR_nextelectiont1=-1.7 if next_election==-3721 & elecdate==-4933 & country_id==8 & partyname=="SP"

replace LR_nextelectiont1=42.6 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=39.2 if next_election==-2378 & elecdate==-3721 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=64.1 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=25.4 if next_election==-1286 & elecdate==-2378 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=-23.5 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PA"
replace LR_nextelectiont1=6.4 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="PP"
replace LR_nextelectiont1=6.4 if next_election==-187 & elecdate==-1286 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=-28.2 if next_election==-67 & elecdate==-187 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=40.4 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-14.4 if next_election==1255 & elecdate==-67 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=18 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-17.4 if next_election==2718 & elecdate==1255 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=15.9 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-29.2 if next_election==4181 & elecdate==2718 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=-17.2 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PA"
replace LR_nextelectiont1=-19.9 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="PP"
replace LR_nextelectiont1=-22.2 if next_election==5294 & elecdate==4181 & country_id==8 & partyname=="ULL"

replace LR_nextelectiont1=46.7 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=82.2 if next_election==6750 & elecdate==5294 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=-10.9 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PA"
replace LR_nextelectiont1=-1.6 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="PP"
replace LR_nextelectiont1=-5.4 if next_election==7276 & elecdate==6750 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=-5.6 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=9.05 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PA"
replace LR_nextelectiont1=8.45 if next_election==8513 & elecdate==7276 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=39.8 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=18.5 if next_election==9976 & elecdate==8513 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=-0.1 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="CP"
replace LR_nextelectiont1=28.7 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-6.4 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PA"
replace LR_nextelectiont1=-10.4 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="PP"
replace LR_nextelectiont1=-18 if next_election==11432 & elecdate==9976 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=47.02 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-12.41 if next_election==12881 & elecdate==11432 & country_id==8 & partyname=="SDP"

replace LR_nextelectiont1=10.28 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-21.09 if next_election==14372 & elecdate==12881 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=18.18 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-9.77 if next_election==15835 & elecdate==14372 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=3.8 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-11.56 if next_election==17298 & elecdate==15835 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=3.8 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-23.19 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="LG"
replace LR_nextelectiont1=-24.29 if next_election==18012 & elecdate==17298 & country_id==8 & partyname=="SDA"

replace LR_nextelectiont1=1.39 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="LG"
replace LR_nextelectiont1=-10 if next_election==19475 & elecdate==18012 & country_id==8 & partyname=="SDA"

replace LR_nextelectiont1=13.45 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-17.09 if next_election==20756 & elecdate==19475 & country_id==8 & partyname=="PP"

replace LR_nextelectiont1=-15.21 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="BF"
replace LR_nextelectiont1=9.18 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-11.23 if next_election==21120 & elecdate==20756 & country_id==8 & partyname=="RP"

replace LR_nextelectiont1=-0.63 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="IP"
replace LR_nextelectiont1=-28.62 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="LG"
replace LR_nextelectiont1=-55 if next_election==21120+1428 & elecdate==21120 & country_id==8 & partyname=="PP"
 
 
* IRELAND *  
 
replace LR_nextelectiont1=-3.92 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnP"
replace LR_nextelectiont1=-6.67 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="CnT"
replace LR_nextelectiont1=51.7 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-19.2 if next_election==-3138 & elecdate==-4349 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=-6.5 if next_election==-2054 & elecdate==-3138 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=0 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="CnT"
replace LR_nextelectiont1=22.2 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-17.5 if next_election==-1032 & elecdate==-2054 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=30.3 if next_election==642 & elecdate==-1032 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=33.3 if next_election==1923 & elecdate==642 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=-0.5 if next_election==3456 & elecdate==1923 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=34.5 if next_election==4807 & elecdate==3456 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=-19.1 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-19.1 if next_election==6376 & elecdate==4807 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=-4.2 if next_election==7832 & elecdate==6376 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=7.4 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-8.7 if next_election==8084 & elecdate==7832 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=-8 if next_election==8363 & elecdate==8084 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=16.15 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-40 if next_election==9909 & elecdate==8363 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=-2.97 if next_election==10758 & elecdate==9909 & country_id==9 & partyname=="FF"

replace LR_nextelectiont1=-8.42 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="FF"
replace LR_nextelectiont1=-2.92 if next_election==12017 & elecdate==10758 & country_id==9 & partyname=="PD"

replace LR_nextelectiont1=-3.41 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FF"
replace LR_nextelectiont1=9.71 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-14.6 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="Lab"
replace LR_nextelectiont1=-26.712 if next_election==13671 & elecdate==12017 & country_id==9 & partyname=="WP-DL"

replace LR_nextelectiont1=4.8 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="FF"
replace LR_nextelectiont1=19.62 if next_election==15477 & elecdate==13671 & country_id==9 & partyname=="PD"

replace LR_nextelectiont1=-6.25 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="FF"
replace LR_nextelectiont1=-9.98 if next_election==17310 & elecdate==15477 & country_id==9 & partyname=="PD"

replace LR_nextelectiont1=-9.76 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="FF"
replace LR_nextelectiont1=-20.13 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="GR"
replace LR_nextelectiont1=-6.86 if next_election==18683 & elecdate==17310 & country_id==9 & partyname=="PD"

replace LR_nextelectiont1=0.73 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="FG"
replace LR_nextelectiont1=-10.59 if next_election==20510 & elecdate==18683 & country_id==9 & partyname=="Lab"

replace LR_nextelectiont1=-18.11 if next_election==20510+1443 & elecdate==20510 & country_id==9 & partyname=="FG"


* Italy *

replace LR_nextelectiont1=29.17 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-22.62 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PCI-PDS-DS"
replace LR_nextelectiont1=-9.38 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-5.56 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-31.82 if next_election==-4275 & elecdate==-4961 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=7.14 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=45 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-22.41 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-13.79 if next_election==-2399 & elecdate==-4275 & country_id==10 & partyname=="PSDI"

replace LR_nextelectiont1=-12.77 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-0.46 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-25 if next_election==-586 & elecdate==-2399 & country_id==10 & partyname=="PSDI"

replace LR_nextelectiont1=-9.65 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-19.3 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-24.07 if next_election==1213 & elecdate==-586 & country_id==10 & partyname=="PSDI"

replace LR_nextelectiont1=-5.86 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-21.44 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-29.51 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=-31.24 if next_election==3061 & elecdate==1213 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=-10.79 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=1.54 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-18.7 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=-18.7 if next_election==4510 & elecdate==3061 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=3.57 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-6.83 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-3.96 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-11.45 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=-40.17 if next_election==6016 & elecdate==4510 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=3.17 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=3.72 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-6.93 if next_election==7093 & elecdate==6016 & country_id==10 & partyname=="PSDI"

replace LR_nextelectiont1=-6.29 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=-5.03 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-2.78 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=2.49 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=-11.19 if next_election==8577 & elecdate==7093 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=-2.62 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=3.55 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=-0.2 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=-11.31 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=-6.75 if next_election==10026 & elecdate==8577 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=4.25 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=30.37 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=45.76 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PRI"
replace LR_nextelectiont1=18.28 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=4.24 if next_election==11784 & elecdate==10026 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=8.78 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="DC"
replace LR_nextelectiont1=10.56 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PLI"
replace LR_nextelectiont1=2.33 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSDI"
replace LR_nextelectiont1=8.02 if next_election==12505 & elecdate==11784 & country_id==10 & partyname=="PSI"

replace LR_nextelectiont1=6.62 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="AN"
replace LR_nextelectiont1=37.92 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelectiont1=8.64 if next_election==13260 & elecdate==12505 & country_id==10 & partyname=="LN"

replace LR_nextelectiont1=33.67 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="Dem."
replace LR_nextelectiont1=16.82 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PCI-PDS-DS"
replace LR_nextelectiont1=18.03 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PPI"
replace LR_nextelectiont1=-26.99 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="PdCI"
replace LR_nextelectiont1=35.29 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="RI"
replace LR_nextelectiont1=-11.52 if next_election==15108 & elecdate==13260 & country_id==10 & partyname=="Verdi"

replace LR_nextelectiont1=18.68 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="AN"
replace LR_nextelectiont1=18.68 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelectiont1=18.68 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="LN"
replace LR_nextelectiont1=18.68 if next_election==16901 & elecdate==15108 & country_id==10 & partyname=="NPSI"

replace LR_nextelectiont1=-17.71 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="IdV"
replace LR_nextelectiont1=-17.71 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="PdCI"
replace LR_nextelectiont1=-17.71 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="RnP"
replace LR_nextelectiont1=-17.71 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="UDR-UDEUR"
replace LR_nextelectiont1=-17.71 if next_election==17636 & elecdate==16901 & country_id==10 & partyname=="Verdi"

replace LR_nextelectiont1=13.89 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelectiont1=-3.75 if next_election==19414 & elecdate==17636 & country_id==10 & partyname=="LN"

replace LR_nextelectiont1=33.65 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="CCD-CDU-UDC"
replace LR_nextelectiont1=3.81 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="FI-PdL"
replace LR_nextelectiont1=-6.86 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="PD"
replace LR_nextelectiont1=1.19 if next_election==21247 & elecdate==19414 & country_id==10 & partyname=="SC"

* The Netherlands *

replace LR_nextelectiont1=3.9 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-19.8 if next_election==-4195 & elecdate==-4977 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=20.6 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=6.5 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-14.8 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="PvdA"
replace LR_nextelectiont1=20 if next_election==-2746 & elecdate==-4195 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=15.6 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=23.75 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=19.7 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-22.6 if next_election==-1297 & elecdate==-2746 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=8.5 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=26.9 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=8.6 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-21 if next_election==-295 & elecdate==-1297 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=16.9 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=14 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=-9.1 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=17.4 if next_election==1230 & elecdate==-295 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=2.4 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=-2.4 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=-13.3 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-30.6 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="PvdA"
replace LR_nextelectiont1=9.7 if next_election==2602 & elecdate==1230 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-5.5 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=10.4 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=7.2 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=10.3 if next_election==4135 & elecdate==2602 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-18.1 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=-21.4 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="CHU"
replace LR_nextelectiont1=-12.9 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="DS70"
replace LR_nextelectiont1=-26.2 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-1.8 if next_election==4716 & elecdate==4135 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-14 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="ARP"
replace LR_nextelectiont1=-44.5 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=-14 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="KVP"
replace LR_nextelectiont1=-44.5 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PPR"
replace LR_nextelectiont1=-44.5 if next_election==6354 & elecdate==4716 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=-11.6 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=13.4 if next_election==7816 & elecdate==6354 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-19.3 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=-22.1 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=-28.6 if next_election==8286 & elecdate==7816 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=-11.7 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=21 if next_election==9637 & elecdate==8286 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-4 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=6.6 if next_election==10841 & elecdate==9637 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-8.8 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=-20.6 if next_election==12541 & elecdate==10841 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=-8.24 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=4.26 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="PvdA"
replace LR_nextelectiont1=15.12 if next_election==14005 & elecdate==12541 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-17.77 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=-22.07 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="PvdA"
replace LR_nextelectiont1=7.24 if next_election==15475 & elecdate==14005 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=2.47 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=14.96 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="LPF"
replace LR_nextelectiont1=18.92 if next_election==15727 & elecdate==15475 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=2.47 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=8.39 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=28.08 if next_election==17127 & elecdate==15727 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=4 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=8.82 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="CU"
replace LR_nextelectiont1=0.84 if next_election==18422 & elecdate==17127 & country_id==12 & partyname=="PvdA"

replace LR_nextelectiont1=9.58 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=19.38 if next_election==19248 & elecdate==18422 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=-6.56 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="PvdA"
replace LR_nextelectiont1=22.63 if next_election==20893 & elecdate==19248 & country_id==12 & partyname=="VVD"

replace LR_nextelectiont1=3.6 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CDA"
replace LR_nextelectiont1=5.47 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="CU"
replace LR_nextelectiont1=-6.51 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="D66"
replace LR_nextelectiont1=10.95 if next_election==20893+1461 & elecdate==20893 & country_id==12 & partyname=="VVD"

* NORWAY *

replace LR_nextelectiont1=-32.8 if next_election==-3735 & elecdate==-5198 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-36.6 if next_election==-2272 & elecdate==-3735 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-31.2 if next_election==-816 & elecdate==-2272 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-32.1 if next_election==619 & elecdate==-816 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-27.1 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=5.6 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=8.2 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-5.7 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="SP"
replace LR_nextelectiont1=-17.5 if next_election==2082 & elecdate==619 & country_id==13 & partyname=="V"

replace LR_nextelectiont1=-4.2 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-3.3 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-15.1 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="SP"
replace LR_nextelectiont1=-34.3 if next_election==3538 & elecdate==2082 & country_id==13 & partyname=="V"

replace LR_nextelectiont1=-34.6 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-1.4 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-18.5 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-17.4 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="SP"
replace LR_nextelectiont1=-30.9 if next_election==5001 & elecdate==3538 & country_id==13 & partyname=="V"

replace LR_nextelectiont1=-36.6 if next_election==6464 & elecdate==5001 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-31.6 if next_election==7927 & elecdate==6464 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=8.2 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-8 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-14.8 if next_election==9383 & elecdate==7927 & country_id==13 & partyname=="SP"

replace LR_nextelectiont1=-25.5 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-7.9 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-12.1 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-12.4 if next_election==10846 & elecdate==9383 & country_id==13 & partyname=="SP"

replace LR_nextelectiont1=-36 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-7.1 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-21.4 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-19.9 if next_election==12309 & elecdate==10846 & country_id==13 & partyname=="SP"

replace LR_nextelectiont1=-19.71 if next_election==13772 & elecdate==12309 & country_id==13 & partyname=="A"

replace LR_nextelectiont1=-18.11 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-4.55 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-10.55 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="SP"
replace LR_nextelectiont1=-7.9 if next_election==15228 & elecdate==13772 & country_id==13 & partyname=="V"

replace LR_nextelectiont1=9.79 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-18.57 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-15.5 if next_election==16691 & elecdate==15228 & country_id==13 & partyname=="V"

replace LR_nextelectiont1=-33.29 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-38.1 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SF-SV"
replace LR_nextelectiont1=-17.61 if next_election==18154 & elecdate==16691 & country_id==13 & partyname=="SP"

replace LR_nextelectiont1=-29.79 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="A"
replace LR_nextelectiont1=-40.11 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SF-SV"
replace LR_nextelectiont1=-20.41 if next_election==19610 & elecdate==18154 & country_id==13 & partyname=="SP"

replace LR_nextelectiont1=-1.95 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="FRP"
replace LR_nextelectiont1=-9.01 if next_election==21073 & elecdate==19610 & country_id==13 & partyname=="H"

replace LR_nextelectiont1=14.16 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="FRP"
replace LR_nextelectiont1=-7.81 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="H"
replace LR_nextelectiont1=-12.33 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="KRF"
replace LR_nextelectiont1=-13.38 if next_election==21073+1463 & elecdate==21073 & country_id==13 & partyname=="V"
 
* PORTUGAL *
 
replace LR_nextelectiont1=-3.65 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=31.28 if next_election==7275 & elecdate==5959 & country_id==14 & partyname=="PS"

replace LR_nextelectiont1=9.42 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=9.42 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PPM"
replace LR_nextelectiont1=9.42 if next_election==7583 & elecdate==7275 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=19.43 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=19.43 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PPM"
replace LR_nextelectiont1=19.43 if next_election==8515 & elecdate==7583 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=-12 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PS"
replace LR_nextelectiont1=-20.97 if next_election==9410 & elecdate==8515 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=26.09 if next_election==10061 & elecdate==9410 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=25.73 if next_election==11601 & elecdate==10061 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=-8.77 if next_election==13057 & elecdate==11601 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=-16.69 if next_election==14527 & elecdate==13057 & country_id==14 & partyname=="PS"

replace LR_nextelectiont1=-17.7 if next_election==15416 & elecdate==14527 & country_id==14 & partyname=="PS"

replace LR_nextelectiont1=16.2 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=1.15 if next_election==16487 & elecdate==15416 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=-10.22 if next_election==18167 & elecdate==16487 & country_id==14 & partyname=="PS"

replace LR_nextelectiont1=-4.5 if next_election==18783 & elecdate==18167 & country_id==14 & partyname=="PS"

replace LR_nextelectiont1=22.82 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=12.81 if next_election==20365 & elecdate==18783 & country_id==14 & partyname=="PSD"

replace LR_nextelectiont1=0.6 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="CDS-PP"
replace LR_nextelectiont1=-4.53 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PS"
replace LR_nextelectiont1=0.6 if next_election==20365+1463 & elecdate==20365 & country_id==14 & partyname=="PSD"

* SPAIN *
 
replace LR_nextelectiont1=-0.47 if next_election==6999 & elecdate==6375 & country_id==15 & partyname=="UCD"

replace LR_nextelectiont1=0.47 if next_election==8336 & elecdate==6999 & country_id==15 & partyname=="UCD"

replace LR_nextelectiont1=-10.95 if next_election==9669 & elecdate==8336 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=-11.65 if next_election==10894 & elecdate==9669 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=-22.31 if next_election==12210 & elecdate==10894 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=-23.21 if next_election==13211 & elecdate==12210 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=9.87 if next_election==14681 & elecdate==13211 & country_id==15 & partyname=="PP"

replace LR_nextelectiont1=3.59 if next_election==16144 & elecdate==14681 & country_id==15 & partyname=="PP"

replace LR_nextelectiont1=-12.39 if next_election==17600 & elecdate==16144 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=-22.9 if next_election==18951 & elecdate==17600 & country_id==15 & partyname=="PSOE"

replace LR_nextelectiont1=-3.45 if next_election==20442 & elecdate==18951 & country_id==15 & partyname=="PP"

replace LR_nextelectiont1=-4.25 if next_election==20631 & elecdate==20442 & country_id==15 & partyname=="PP"

replace LR_nextelectiont1=-4.25 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PP"
replace LR_nextelectiont1=-24.62 if next_election==20631+1036 & elecdate==20631 & country_id==15 & partyname=="PSOE"


* SWEDEN *

replace LR_nextelectiont1=-37.8 if next_election==-4121 & elecdate==-5584 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=-4.9 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="C"

replace LR_nextelectiont1=-33.4 if next_election==-2658 & elecdate==-4121 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=1.2 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="C" 
replace LR_nextelectiont1=-28.3 if next_election==-1202 & elecdate==-2658 & country_id==16 & partyname=="S" 

replace LR_nextelectiont1=1.8 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=-44.2 if next_election==-579 & elecdate==-1202 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=-24.7 if next_election==261 & elecdate==-579 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-61.4 if next_election==1724 & elecdate==261 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-33.6 if next_election==3180 & elecdate==1724 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-42.9 if next_election==3915 & elecdate==3180 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-41.2 if next_election==5007 & elecdate==3915 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-7.7 if next_election==6106 & elecdate==5007 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=-18.2 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=-2.1 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="L"
replace LR_nextelectiont1=2.2 if next_election==7198 & elecdate==6106 & country_id==16 & partyname=="M"

replace LR_nextelectiont1=-8.1 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=-15.2 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="L"
replace LR_nextelectiont1=23.1 if next_election==8297 & elecdate==7198 & country_id==16 & partyname=="M"


replace LR_nextelectiont1=-18.5 if next_election==9389 & elecdate==8297 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-21.1 if next_election==10488 & elecdate==9389 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-23.9 if next_election==11580 & elecdate==10488 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=5.43 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=-4.54 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="KD"
replace LR_nextelectiont1=3.93 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="L"
replace LR_nextelectiont1=43.75 if next_election==12679 & elecdate==11580 & country_id==16 & partyname=="M"


replace LR_nextelectiont1=23.79 if next_election==14142 & elecdate==12679 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-3.52 if next_election==15598 & elecdate==14142 & country_id==16 & partyname=="S"
replace LR_nextelectiont1=-18.32 if next_election==17061 & elecdate==15598 & country_id==16 & partyname=="S"

replace LR_nextelectiont1=-4.46 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=0.81 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="KD"
replace LR_nextelectiont1=14.54 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="L"
replace LR_nextelectiont1=3.96 if next_election==18524 & elecdate==17061 & country_id==16 & partyname=="M"

replace LR_nextelectiont1=-2.24 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="C"
replace LR_nextelectiont1=8.14 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="KD"
replace LR_nextelectiont1=-4.8 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="L"
replace LR_nextelectiont1=2.48 if next_election==19980 & elecdate==18524 & country_id==16 & partyname=="M"

replace LR_nextelectiont1=-26.16 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="MP"
replace LR_nextelectiont1=-52.49 if next_election==21436 & elecdate==19980 & country_id==16 & partyname=="S"


* UK *

replace LR_nextelectiont1=-31.3 if next_election==-3599 & elecdate==-5293 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=-28.1 if next_election==-2990 & elecdate==-3599 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=-1.4 if next_election==-1681 & elecdate==-2990 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=-30.6 if next_election==-85 & elecdate==-1681 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=-23.3 if next_election==1749 & elecdate==-85 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=-23.8 if next_election==2281 & elecdate==1749 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=-14.8 if next_election==3821 & elecdate==2281 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=8.2 if next_election==5172 & elecdate==3821 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=-48.5 if next_election==5396 & elecdate==5172 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=-27.5 if next_election==7062 & elecdate==5396 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=24.4 if next_election==8560 & elecdate==7062 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=29 if next_election==10023 & elecdate==8560 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=30.47 if next_election==11787 & elecdate==10023 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=27.9 if next_election==13635 & elecdate==11787 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=8.07 if next_election==15133 & elecdate==13635 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=1.47 if next_election==16561 & elecdate==15133 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=-3.09 if next_election==18388 & elecdate==16561 & country_id==17 & partyname=="Lab"

replace LR_nextelectiont1=17.54 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Con"
replace LR_nextelectiont1=4.66 if next_election==20215 & elecdate==18388 & country_id==17 & partyname=="Lib"

replace LR_nextelectiont1=-1.57 if next_election==20978 & elecdate==20215 & country_id==17 & partyname=="Con"

replace LR_nextelectiont1=-2.61 if next_election==20978+917 & elecdate==20978 & country_id==17 & partyname=="Con"

gen extremism=.
replace extremism=(LR_nextelection-LR_nextelectiont1)*-1 if LR_nextelection<0 & LR_nextelectiont1<0
replace extremism=LR_nextelection-LR_nextelectiont1 if (LR_nextelection>0 & LR_nextelection<101) & (LR_nextelectiont1>0 & LR_nextelectiont1<101)
replace extremism=LR_nextelection+LR_nextelectiont1 if (LR_nextelection>0 & LR_nextelection<101) & LR_nextelectiont1<0
replace extremism=(LR_nextelection+LR_nextelectiont1)*-1 if LR_nextelection<0 & (LR_nextelectiont1>0 & LR_nextelectiont1<101)
replace extremism=abs(LR_nextelection-LR_nextelectiont1) if LR_nextelection==0 & LR_nextelectiont1~=0
replace extremism=abs(LR_nextelection-LR_nextelectiont1)*-1 if LR_nextelection~=0 & LR_nextelectiont1==0

** Dataset cleanup: remove excess variables ** 

drop LR_nextelection LR_nextelectiont1



** INPUTTING VARIABLES FOR PM DISSOLUTION POWER **

gen PM_dissolutionpower=.
replace PM_dissolutionpower=0 if country_id==1
replace PM_dissolutionpower=0 if country_id==2
replace PM_dissolutionpower=10 if country_id==3
replace PM_dissolutionpower=0 if country_id==4 & year_of_election<1992
replace PM_dissolutionpower=5 if country_id==4 & year_of_election>1991 & year_of_election<2030
replace PM_dissolutionpower=2.5 if country_id==5
replace PM_dissolutionpower=0 if country_id==6
replace PM_dissolutionpower=0 if country_id==7
replace PM_dissolutionpower=10 if country_id==8
replace PM_dissolutionpower=0 if country_id==9
replace PM_dissolutionpower=0 if country_id==10
replace PM_dissolutionpower=0 if country_id==12
replace PM_dissolutionpower=0 if country_id==13
replace PM_dissolutionpower=0 if country_id==14
replace PM_dissolutionpower=8.55 if country_id==15
replace PM_dissolutionpower=0 if country_id==16 & year_of_election<1972
replace PM_dissolutionpower=9.58 if country_id==16 & year_of_election>1971 & year_of_election<1976
replace PM_dissolutionpower=0 if country_id==16 & year_of_election>1975 & year_of_election<2030
replace PM_dissolutionpower=10 if country_id==17 & year_of_election<2011
replace PM_dissolutionpower=0 if country_id==17 & year_of_election>2010 & year_of_election<2030

gen strong_PMdisspowers=1 if PM_dissolutionpower>7.9 & PM_dissolutionpower<11
replace strong_PMdisspowers=0 if PM_dissolutionpower<8


gen govt_dissolutionpower=.
replace govt_dissolutionpower=7 if country_id==1
replace govt_dissolutionpower=8.5 if country_id==2
replace govt_dissolutionpower=10 if country_id==3
replace govt_dissolutionpower=0 if country_id==4 & year_of_election<1992
replace govt_dissolutionpower=5 if country_id==4 & year_of_election>1991 & year_of_election<2030
replace govt_dissolutionpower=0 if country_id==5
replace govt_dissolutionpower=2.5 if country_id==6
replace govt_dissolutionpower=4.25 if country_id==7
replace govt_dissolutionpower=0 if country_id==8
replace govt_dissolutionpower=10 if country_id==9
replace govt_dissolutionpower=0 if country_id==10
replace govt_dissolutionpower=8.5 if country_id==12
replace govt_dissolutionpower=0 if country_id==13
replace govt_dissolutionpower=3.44 if country_id==14 & year_of_election<1983
replace govt_dissolutionpower=0 if country_id==14 & year_of_election>1982 & year_of_election<2030
replace govt_dissolutionpower=8.55 if country_id==15
replace govt_dissolutionpower=8.5 if country_id==16 & year_of_election<1972
replace govt_dissolutionpower=9.58 if country_id==16 & year_of_election>1971 & year_of_election<1976
replace govt_dissolutionpower=8.29 if country_id==16 & year_of_election>1975 & year_of_election<2030
replace govt_dissolutionpower=10 if country_id==17 & year_of_election<2011
replace govt_dissolutionpower=10 if country_id==17 & year_of_election>2010 & year_of_election<2030

gen strong_govtdisspowers=1 if govt_dissolutionpower>7.9 & govt_dissolutionpower<11
replace strong_govtdisspowers=0 if govt_dissolutionpower<8


** Dataset cleanup: remove excess variables **
drop PM_dissolutionpower govt_dissolutionpower

** Indicator variable for single-issue parties **

gen single_issue=0
replace single_issue=1 if partyname=="AN" | partyname=="CnP" | partyname=="E" | partyname=="FPÖ" | partyname=="FRP" | partyname=="G" | partyname=="GR" | partyname=="LAOS" | partyname=="LG" | partyname=="LN" | partyname=="LPF" | partyname=="MP" | partyname=="PPM" | partyname=="SMP" | partyname=="VIHR"




***** VARIABLE GENERATION *****



egen electbycountry=group(next_election country_id)
egen elect_party_country=group(next_election partyname country_id)
egen elect_cab_country=group(next_election cab_id country_id)

gen number_of_partners=cab_num_parties-1

gen PM_party=.
replace PM_party=1 if cab_party1==partyname & country_id<18
replace PM_party=0 if cab_party1~=partyname & country_id<18

gen junior=.
replace junior=1 if cab_party1~=partyname & country_id<18
replace junior=0 if cab_party1==partyname & country_id<18

gen coalition=1 if number_of_partners>0 & number_of_partners<8
replace coalition=0 if number_of_partners==0
 
gen minority=1 if govtype==1
replace minority=0 if govtype==2 | govtype==3 | govtype==4 | govtype==5

gen time_to_nextelection=next_election-date_out 
replace time_to_nextelection=0 if time_to_nextelection<0

gen caretaker=.
replace caretaker=1 if techno_remit==0
replace caretaker=0 if techno_remit==1
replace caretaker=0 if techno_remit==. & country_id==6
replace caretaker=1 if techno_remit==. & country_id==1

by elect_party_country, sort: egen last_govt=min(time_to_nextelection) if caretaker==0
replace last_govt=0 if country_id==31 | country_id==32 | country_id==33 | country_id==34

gen last_govt_beforeelection=.
replace last_govt_beforeelection=1 if time_to_nextelection==last_govt
replace last_govt_beforeelection=0 if time_to_nextelection~=last_govt
replace last_govt_beforeelection=. if country_id>17 & country_id<31

by electbycountry, sort: egen last_cab =min(time_to_nextelection) if time_to_nextelection~=. & caretaker==0
replace last_cab=0 if country_id==31 | country_id==32 | country_id==33 | country_id==34

gen last_cab_beforeelection=.
replace last_cab_beforeelection=1 if time_to_nextelection==last_cab & caretaker==0
replace last_cab_beforeelection=0 if time_to_nextelection~=last_cab & caretaker==0
replace last_cab_beforeelection=. if country_id>17 & country_id<3

replace last_cab_beforeelection=1 if cab_name=="Kurz I"
replace last_cab_beforeelection=1 if cab_name=="Karjalainen IV" 
replace last_cab_beforeelection=1 if cab_name=="Sorsa I"
replace last_cab_beforeelection=1 if cab_name=="Papandreou"
replace last_cab_beforeelection=1 if cab_name=="Tsipras I"
replace last_cab_beforeelection=1 if cab_name=="Colombo"
replace last_cab_beforeelection=1 if cab_name=="Andreotti III"
replace last_cab_beforeelection=1 if cab_name=="Craxi"
replace last_cab_beforeelection=1 if cab_name=="Cals"
replace last_cab_beforeelection=1 if cab_name=="Biesheuvel I"
replace last_cab_beforeelection=1 if cab_name=="Van Agt II"
replace last_cab_beforeelection=1 if cab_name=="Balkenende II"
replace last_cab_beforeelection=1 if cab_name=="Balkenende IV"
replace last_cab_beforeelection=1 if cab_name=="Soares II"

gen opposition=.
replace opposition=1 if last_govt_beforeelection==1 & last_cab_beforeelection~=1
replace opposition=0 if last_govt_beforeelection==1 & last_cab_beforeelection==1
replace opposition=0 if last_govt_beforeelection==0

** Dataset cleanup: remove excess variables ** 

drop last_cab_beforeelection

***** INTRA-PARTY DISSOLUTIONS, PER CABINET *****

gen diss_intra=.
replace diss_intra=1 if term_disc_intra==1 & country_id<18
replace diss_intra=0 if term_disc_intra==0 & country_id<18


gen diss_intra_responsible=.
replace diss_intra_responsible=1 if term_disc_intra_party==partyname & country_id<18
replace diss_intra_responsible=0 if term_disc_intra==0 & country_id<18
replace diss_intra_responsible=0 if term_disc_intra==1 & term_disc_intra_party~=partyname & country_id<18
replace diss_intra_responsible=1 if term_disc_intra==1 & term_disc_intra_party=="DC, PSI" & (partyname=="DC" | partyname=="PSI") & country_id<18
replace diss_intra_responsible=1 if term_disc_intra==1 & term_disc_intra_party=="LSDP, DP, NS-SL" & (partyname=="LSDP" | partyname=="DP" | partyname=="NS-SL") & country_id<18
replace diss_intra_responsible=1 if term_disc_intra==1 & term_disc_intra_party=="SPD, FDP" & (partyname=="SPD" | partyname=="FDP") & country_id<18
replace diss_intra_responsible=. if country_id>17 & country_id<31

gen diss_intra_responsible2=.
replace diss_intra_responsible2=1 if term_disc_intra_party==partyname & country_id<18
replace diss_intra_responsible2=0 if term_disc_intra==0 & country_id<18
replace diss_intra_responsible2=0 if term_disc_intra==1 & term_disc_intra_party~=partyname & country_id<18
replace diss_intra_responsible2=1 if term_disc_intra==1 & term_disc_intra_party=="DC, PSI" & (partyname=="DC" | partyname=="PSI") & country_id<18
replace diss_intra_responsible2=1 if term_disc_intra==1 & term_disc_intra_party=="LSDP, DP, NS-SL" & (partyname=="LSDP" | partyname=="DP" | partyname=="NS-SL") & country_id<18
replace diss_intra_responsible2=1 if term_disc_intra==1 & term_disc_intra_party=="SPD, FDP" & (partyname=="SPD" | partyname=="FDP") & country_id<18
replace diss_intra_responsible2=1 if cab_name=="Eden II" & country_id==17
replace diss_intra_responsible2=1 if cab_name=="Macmillan II" & country_id==17
replace diss_intra_responsible2=1 if cab_name=="Thatcher III" & country_id==17
replace diss_intra_responsible2=1 if cab_name=="Blair III" & country_id==17
replace diss_intra_responsible=. if country_id>17 & country_id<31

gen diss_intrapol_responsible2=.
replace diss_intrapol_responsible2=0 if diss_intra==0
replace diss_intrapol_responsible2=0 if diss_intra_responsible==0
replace diss_intrapol_responsible2=0 if diss_intra_responsible==1 & coalition==0

replace diss_intrapol_responsible2=1 if diss_intra_responsible==1 & country_id==2 & cab_name=="Pholien"
replace diss_intrapol_responsible2=1 if diss_intra_responsible==1 & country_id==10 & cab_name=="Leone I"

replace diss_intrapol_responsible2=1 if diss_intra_responsible==1 & coalition==0 & term_event_popshock==0 & term_event_pers==0 & term_event_nonparlelec==0

replace diss_intrapol_responsible2=1 if diss_intra_responsible==1 & coalition==1 

replace diss_intrapol_responsible2=0 if diss_intra_responsible==1 & coalition==1 & (term_event_popshock==1 | term_event_pers==1 | term_event_nonparlelec==1)

replace diss_intrapol_responsible2=. if country_id>17 & country_id<35


***** INTERPARTY DISSOLUTIONS, PER CABINET *****

gen term_disc_interparty=.
replace term_disc_interparty=1 if term_disc_conflict_pol==1 
replace term_disc_interparty=1 if term_disc_conflict_pers==1
replace term_disc_interparty=0 if term_disc_conflict_pol==0 & term_disc_conflict_pers==0

gen diss_inter_responsible=.
replace diss_inter_responsible=0 if term_disc_interparty==0
replace diss_inter_responsible=0 if term_disc_interparty==1
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="AN, FI-PdL, LN" & (partyname=="AN" | partyname=="FI-PdL" | partyname=="LN")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="C, L, M" & (partyname=="C" | partyname=="L" | partyname=="M")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CD, S, RV" & (partyname=="CD" | partyname=="S" | partyname=="RV")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CDA, PvdA" & (partyname=="CDA" | partyname=="PvdA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CDU-CSU, FDP" & (partyname=="CDU-CSU" | partyname=="FDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CDV, cdH, FDF, PS, SP" & (partyname=="CDV" | partyname=="CdH" | partyname=="FDF" | partyname=="PS" | partyname=="SP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CDV, cdH, VLD, MR, RW" & (partyname=="CDV" | partyname=="CdH" | partyname=="VLD" | partyname=="MR" | partyname=="RW")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CDV, cdH, VU, VLD, MR" & (partyname=="CDV" | partyname=="CdH" | partyname=="VU" | partyname=="VLD" | partyname=="MR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="CVP-PSC, LP-PL" & (partyname=="CVP-PSC" | partyname=="LP-PL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PLI" & (partyname=="DC" | partyname=="PLI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PRI" & (partyname=="DC" | partyname=="PRI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PRI, PSI" & (partyname=="DC" | partyname=="PRI" | partyname=="PSI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PSDI" & (partyname=="DC" | partyname=="PSDI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PSI" & (partyname=="DC" | partyname=="PSI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PSI, PCI" & (partyname=="DC" | partyname=="PSI" | partyname=="PCI-PDS-DS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PSI, PRI" & (partyname=="DC" | partyname=="PSI" | partyname=="PRI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DC, PSI, PSDI" & (partyname=="DC" | partyname=="PSI" | partyname=="PSDI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="DS7, KVP" & (partyname=="DS70" | partyname=="KVP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="E" & (partyname=="E")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FF, GR" & (partyname=="FF" | partyname=="GR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FF, Lab" & (partyname=="FF" | partyname=="Lab")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FF, PD" & (partyname=="FF" | partyname=="PD")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FG, CnP" & (partyname=="FG" | partyname=="CnP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FG, Lab" & (partyname=="FG" | partyname=="Lab")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="FI-PdL, LN, AN, UDC" & (partyname=="FI-PdL" | partyname=="LN" | partyname=="AN" | partyname=="CCD-CDU-UDC")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="G" & (partyname=="G")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="H, FRP, V, KRF" & (partyname=="H" | partyname=="FRP" | partyname=="V" | partyname=="KRF")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="HDZ, DC" & (partyname=="HDZ" | partyname=="DC")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="HDZ, HSLS" & (partyname=="HDZ" | partyname=="HSLS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="HDZ, MOST" & (partyname=="HDZ" | partyname=="MOST")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="HNS" & (partyname=="HNS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="HSLS" & (partyname=="HSLS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="IDS" & (partyname=="IDS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="IP, SDA" & (partyname=="IP" | partyname=="SDA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="IP, SDP, PP" & (partyname=="IP" | partyname=="SDP" | partyname=="PP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KESK, KOK" & (partyname=="KESK"| partyname=="KOK")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KESK, KOK, RKP, LKP" & (partyname=="KESK" | partyname=="KOK" | partyname=="RKP" | partyname=="LKP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KESK, LKP" & (partyname=="KESK" | partyname=="LKP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KESK, SDP" & (partyname=="KESK" | partyname=="SDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KOK, SDP, RKP, SKL, VIHR" & (partyname=="KOK" | partyname=="SDP" | partyname=="RKP" | partyname=="SKL" | partyname=="VIHR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KOK, SDP, RKP, SKL, VIHR, SKDL" & (partyname=="KOK" | partyname=="SDP" | partyname=="RKP" | partyname=="SKL" | partyname=="VIHR" | partyname=="SKDL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="KVP, PvdA" & (partyname=="KVP" | partyname=="PvdA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="M5S, LN" & (partyname=="M5S" | partyname=="LN")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="N-VA" & (partyname=="N-VA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ND, PASOK, DIMAR" & (partyname=="ND" | partyname=="PASOK" | partyname=="DIMAR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ND, PASOK, LAOS" & (partyname=="ND" | partyname=="PASOK" | partyname=="LAOS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ND, PASOK, SYN" & (partyname=="ND" | partyname=="PASOK" | partyname=="SYN")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PCB-KPB, PSB-BSP, LP-PL" & (partyname=="PCB-KPB" | partyname=="PSB-BSP" | partyname=="LP-PL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PCI-PDS, SDI" & (partyname=="PCI-PDS-DS" | partyname=="SDI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PD, Ex Left" & (partyname=="PCI-PDS-DS" | partyname=="Ex Left")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PD, FI-PdL, SC, CCD-CDU, PR" & (partyname=="PD" | partyname=="FI-PdL" | partyname=="SC" | partyname=="CCD-CDU-UDC" | partyname=="PR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PDL-FLI" & (partyname=="PDL-FLI" | partyname=="FI-PdL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PP, IP" & (partyname=="PP" | partyname=="IP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PP, PA, SDP" & (partyname=="PP" | partyname=="PA" | partyname=="SDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PP, SDP, IP" & (partyname=="PP" | partyname=="SDP" | partyname=="IP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PS, CDS-PP" & (partyname=="PS" | partyname=="CDS-PP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PS, PSD" & (partyname=="PS" | partyname=="PSD" | partyname=="")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSB-BSP, CDV, cdH, VLD, MR" & (partyname=="PSB-BSP" | partyname=="CDV" | partyname=="CdH" | partyname=="VLD" | partyname=="MR")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSB-BSP, CDV-cdH" & (partyname=="PSB-BSP" | partyname=="CDV" | partyname=="CdH")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSB-BSP, CVP-PSC" & (partyname=="PSB-BSP" | partyname=="CVP" | partyname=="PSC")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSI, DC" & (partyname=="PSI" | partyname=="DC")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSI, PRI" & (partyname=="PSI" | partyname=="PRI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PSI, PSDI" & (partyname=="PSI" | partyname=="PSDI")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="PvdA, CDA" & (partyname=="PvdA" | partyname=="CDA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="RKP, KESK" & (partyname=="RKP" | partyname=="KESK")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="RKP, SDP" & (partyname=="RKP" | partyname=="SDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="S, C" & (partyname=="S" | partyname=="C")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SDP" & (partyname=="SDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SDP, HSLS" & (partyname=="SDP"| partyname=="HSLS")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SDP, KESK" & (partyname=="SDP" | partyname=="KESK")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SDP, KOK, RKP, VIHR, SKDL" & (partyname=="SDP" | partyname=="KOK" | partyname=="RKP" | partyname=="VIHR" | partyname=="SKDL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SKDL, KESK" & (partyname=="SKDL" | partyname=="KESK")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SKDL, SDP" & (partyname=="SKDL" | partyname=="SDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SKL, KESK" & (partyname=="SKL" | partyname=="KESK")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SMP, KOK" & (partyname=="SMP" | partyname=="KOK")

replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SP, H" & (partyname=="SP" | partyname=="H")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SP, H, V, KRF" & (partyname=="SP" | partyname=="H" | partyname=="V" | partyname=="KRF")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SP, SDP, IP" & (partyname=="SP" | partyname=="SDP" | partyname=="IP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SPD, FDP" & (partyname=="SPD" | partyname=="FDP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SPÖ, FPÖ" & (partyname=="SPÖ" | partyname=="FPÖ")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SPÖ, ÖVP" & (partyname=="SPÖ" | partyname=="ÖVP")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="SYRIZA, ANEL" & (partyname=="SYRIZA" | partyname=="ANEL")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ULL, PP, PA" & (partyname=="ULL" | partyname=="PP" | partyname=="PA")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="VLD" & (partyname=="VLD")

replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="VVD, CHU" & (partyname=="VVD" | partyname=="CHU")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="VVD, D66" & (partyname=="VVD" | partyname=="D66")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ÖVP, FPÖ" & (partyname=="ÖVP" | partyname=="FPÖ" )
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ÖVP, SPÖ" & (partyname=="ÖVP" | partyname=="SPÖ")
replace diss_inter_responsible=1 if term_disc_interparty==1 & term_disc_conflict_parties=="ÖVP, SPÖ, KPÖ" & (partyname=="ÖVP" | partyname=="SPÖ" | partyname=="KPÖ")

replace diss_inter_responsible=1 if cab_name=="Tindemans IV"
replace diss_inter_responsible=1 if cab_name=="Martens II"
replace diss_inter_responsible=1 if cab_name=="Martens III" & (partyname=="MR" | partyname=="PS" | partyname=="SP" | partyname=="VLD")
replace diss_inter_responsible=1 if cab_name=="Martens IV"
replace diss_inter_responsible=1 if cab_name=="M Eyskens"
replace diss_inter_responsible=1 if cab_name=="Martens VI"
replace diss_inter_responsible=1 if cab_name=="Jorgensen IV"
replace diss_inter_responsible=1 if cab_name=="Benediktsson" & partyname=="IP"
replace diss_inter_responsible=1 if cab_name=="Den Uyl"

gen diss_interpol_responsible=.
replace diss_interpol_responsible=1 if term_disc_conflict_pol==1 & diss_inter_responsible==1
replace diss_interpol_responsible=0 if term_disc_conflict_pol==1 & diss_inter_responsible==0
replace diss_interpol_responsible=0 if term_disc_conflict_pol==0
replace diss_interpol_responsible=0 if term_disc_interparty==0

replace diss_inter_responsible=0 if country_id==1 & year_of_election==2002
replace term_disc_interparty=0 if country_id==1 & year_of_election==2002



gen notresponsible=1 if (diss_intra==1 | term_disc_interparty==1) & (diss_intra_responsible2==0 & diss_inter_responsible==0)
replace notresponsible=0 if diss_intra_responsible2==1 & diss_inter_responsible==1
replace notresponsible=0 if diss_intra_responsible2==1 | diss_inter_responsible==1
replace notresponsible=0 if diss_intra==0 & term_disc_interparty==0

gen termination=1 if diss_intra==1 | term_disc_interparty==1
replace termination=0 if diss_intra==0 & term_disc_interparty==0

gen polresponsible=1 if diss_intrapol_responsible2==1 |  diss_interpol_responsible==1
replace  polresponsible=0 if diss_intrapol_responsible2==0 & diss_interpol_responsible==0
replace polresponsible=0 if diss_intra==0 & term_disc_interparty==0
replace polresponsible=0 if notresponsible==1
replace polresponsible=0 if termination==0

gen compresponsible=1 if termination==1 & notresponsible==0 & polresponsible==0
replace compresponsible=0 if termination==1 & notresponsible==1
replace compresponsible=0 if termination==1 & polresponsible==1
replace compresponsible=0 if termination==0

by elect_party_country, sort: egen times_compresponsible=sum(compresponsible)
by elect_party_country, sort: egen times_polresponsible=sum(polresponsible)
by elect_party_country, sort: egen times_notresponsible=sum(notresponsible)

gen comp_intraresponsible=1 if compresponsible==1 & diss_intra_responsible2==1 & diss_inter_responsible==0
replace comp_intraresponsible=0 if compresponsible==1 & diss_intra_responsible2==1 & diss_inter_responsible==1
replace comp_intraresponsible=0 if compresponsible==1 & diss_intra_responsible2==0 & diss_inter_responsible==1
replace comp_intraresponsible=0 if compresponsible==1 & diss_intra_responsible2==0 & diss_inter_responsible==0
replace comp_intraresponsible=0 if compresponsible==0

gen comp_interresponsible=1 if compresponsible==1 & diss_inter_responsible==1 & diss_intra_responsible2==0
replace comp_interresponsible=0 if compresponsible==1 & diss_inter_responsible==1 & diss_intra_responsible2==1
replace comp_interresponsible=0 if compresponsible==1 & diss_inter_responsible==0 & diss_intra_responsible2==1
replace comp_interresponsible=0 if compresponsible==1 & diss_inter_responsible==0 & diss_intra_responsible2==0
replace comp_interresponsible=0 if compresponsible==0

gen comp_intrainterresponsible=1 if compresponsible==1 & diss_inter_responsible==1 & diss_intra_responsible2==1
replace comp_intrainterresponsible=0 if compresponsible==1 & diss_inter_responsible==1 & diss_intra_responsible2==0
replace comp_intrainterresponsible=0 if compresponsible==1 & diss_inter_responsible==0 & diss_intra_responsible2==1
replace comp_intrainterresponsible=0 if compresponsible==1 & diss_inter_responsible==0 & diss_intra_responsible2==0
replace comp_intrainterresponsible=0 if compresponsible==0 


by cab_name, sort: egen comp_termination=sum(compresponsible)

gen comp_notresponsible=1 if comp_termination>0 & comp_termination<10 & notresponsible==1
replace comp_notresponsible=0 if comp_termination>0 & comp_termination<10 & notresponsible==0
replace comp_notresponsible=0 if comp_termination==0

gen conflict_termination=1 if compresponsible==1 | polresponsible==1| notresponsible==1
replace conflict_termination=0 if compresponsible==0 & polresponsible==0 & notresponsible==0

by elect_party_country, sort: egen times_conflict_termination=sum(conflict_termination)



***** VARIABLE GENERATION, PREPARATION FOR OVERALL HISTORY OF DISSOLUTIONS BETWEEN TWO ELECTIONS *****

gen time_to_nextelection2=time_to_nextelection 
replace time_to_nextelection2=1 if time_to_nextelection==0 & conflict_termination==1

gen junior_partner_intra=1 if diss_intra==1 & PM_party==0
replace junior_partner_intra=0 if diss_intra==1 & PM_party==1
replace junior_partner_intra=0 if diss_intra==0 & PM_party==1
replace junior_partner_intra=0 if diss_intra==0 & PM_party==0

gen junior_partner_inter=1 if term_disc_interparty==1 & PM_party==0
replace junior_partner_inter=0 if term_disc_interparty==1 & PM_party==1
replace junior_partner_inter=0 if term_disc_interparty==0 & PM_party==1
replace junior_partner_inter=0 if term_disc_interparty==0 & PM_party==0

gen junior_partner=0 
replace junior_partner=1 if junior_partner_intra==1 | junior_partner_inter==1

by  elect_party_country, sort: egen times_junior_partner=sum(junior_partner)

gen junior_partner2=0 
replace junior_partner2=1 if junior_partner_intra==1 | junior_partner_inter==1
replace junior_partner2=1 if PM_party==0 & (junior_partner_intra==0 & junior_partner_inter==0)

gen junior_ever=.
replace junior_ever=1 if times_junior_partner>0 & times_junior_partner<100
replace junior_ever=0 if times_junior_partner==0

gen coalition_conflict2=.
replace coalition_conflict2=1 if (term_disc_intra==1 | term_disc_inter==1) & coalition==1
replace coalition_conflict2=1 if (term_disc_intra==0 & term_disc_inter==0) & coalition==1
replace coalition_conflict2=0 if coalition==0

by  elect_party_country, sort: egen times_coalition_conflict2=sum(coalition_conflict2) if country_id<18

gen conflict_coalition2=.
replace conflict_coalition2=1 if times_coalition_conflict2>0 & times_coalition_conflict2<100
replace conflict_coalition2=0 if times_coalition_conflict2==0



***** HISTORY OF INTER-PARTY DISSOLUTIONS *****
 
by elect_party_country, sort: egen times_interdiss=sum(term_disc_interparty)

gen interdiss=.
replace interdiss=1 if times_interdiss>0 & times_interdiss<10
replace interdiss=0 if times_interdiss==0

by elect_party_country, sort: egen times_interdiss_responsible=sum(diss_inter_responsible) 

gen interdiss_responsible=.
replace interdiss_responsible=1 if times_interdiss_responsible>0 & times_interdiss_responsible<10
replace interdiss_responsible=0 if times_interdiss_responsible==0

by elect_party_country, sort: egen times_interpol=sum(term_disc_conflict_pol) 

by elect_party_country, sort: egen times_interpol_responsible=sum(diss_interpol_responsible) 

gen interdisspol_responsible=.
replace interdisspol_responsible=1 if times_interpol_responsible>0 & times_interpol_responsible<10
replace interdisspol_responsible=0 if times_interpol_responsible==0

***** HISTORY OF INTRA-PARTY DISSOLUTIONS *****


by elect_party_country, sort: egen times_intradiss=sum(diss_intra) 

gen intradiss=.
replace intradiss=1 if times_intradiss>0 & times_intradiss<10
replace intradiss=0 if times_intradiss==0

by elect_party_country, sort: egen times_intradiss_responsible=sum(diss_intra_responsible) 

gen intradiss_responsible=.
replace intradiss_responsible=1 if times_intradiss_responsible>0 & times_intradiss_responsible<10
replace intradiss_responsible=0 if times_intradiss_responsible==0

**POLICY TERMINATIONS **

by elect_party_country, sort: egen times_intradisspol_responsible=sum(diss_intrapol_responsible) if country_id<18 & diss_intra~=. & partyvotesharechange~=.

gen intradisspol_responsible=.
replace intradisspol_responsible=1 if times_intradisspol_responsible>0 & times_intradisspol_responsible<10
replace intradisspol_responsible=0 if times_intradisspol_responsible==0

by elect_party_country, sort: egen times_intradisspol_responsible2=sum(diss_intrapol_responsible2) if country_id<18 & diss_intra~=. & partyvotesharechange~=.

gen intradisspol_responsible2=.
replace intradisspol_responsible2=1 if times_intradisspol_responsible2>0 & times_intradisspol_responsible2<10
replace intradisspol_responsible2=0 if times_intradisspol_responsible2==0

gen diss_pol_responsible=0 if country_id<18
replace diss_pol_responsible=1 if intradisspol_responsible==1 | interdisspol_responsible==1

gen diss_pol_responsible2=0 if country_id<18
replace diss_pol_responsible2=1 if intradisspol_responsible2==1 | interdisspol_responsible==1

gen diss_pol_intraonly=1 if intradisspol_responsible2==1 & interdisspol_responsible==0
replace diss_pol_intraonly=0 if intradisspol_responsible2==0 & interdisspol_responsible==1
replace diss_pol_intraonly=0 if intradisspol_responsible2==1 & interdisspol_responsible==1
replace diss_pol_intraonly=0 if intradisspol_responsible2==0 & interdisspol_responsible==0


gen diss_pol_interonly=1 if intradisspol_responsible2==0 & interdisspol_responsible==1
replace diss_pol_interonly=0 if intradisspol_responsible2==1 & interdisspol_responsible==0
replace diss_pol_interonly=0 if intradisspol_responsible2==1 & interdisspol_responsible==1
replace diss_pol_interonly=0 if intradisspol_responsible2==0 & interdisspol_responsible==0

gen diss_pol_intrainter=1 if intradisspol_responsible2==1 & interdisspol_responsible==1
replace diss_pol_intrainter=0 if intradisspol_responsible2==0 & interdisspol_responsible==1
replace diss_pol_intrainter=0 if intradisspol_responsible2==1 & interdisspol_responsible==0
replace diss_pol_intrainter=0 if intradisspol_responsible2==0 & interdisspol_responsible==0

by elect_party_country, sort: egen timesdiss_pol_intra=sum(diss_pol_intraonly)
by elect_party_country, sort: egen timesdiss_pol_inter=sum(diss_pol_interonly)
by elect_party_country, sort: egen timesdiss_pol_intrainter=sum(diss_pol_intrainter)
replace timesdiss_pol_intrainter=timesdiss_pol_intra+timesdiss_pol_inter if timesdiss_pol_intra>0 & timesdiss_pol_intra<10 & timesdiss_pol_inter>0 & timesdiss_pol_inter<10

replace timesdiss_pol_intra=0 if timesdiss_pol_intrainter>0 & timesdiss_pol_intrainter<10
replace timesdiss_pol_inter=0 if timesdiss_pol_intrainter>0 & timesdiss_pol_intrainter<10

gen diss_responsible=0 if country_id<18
replace diss_responsible=1 if intradiss_responsible==1 | interdiss_responsible==1 

gen diss=0 if country_id<18
replace diss=1 if intradiss==1 | interdiss==1

gen diss_notresponsible=1 if diss==1 & diss_responsible==0
replace diss_notresponsible=0 if diss==1 & diss_responsible==1
replace diss_notresponsible=0 if diss==0

by elect_party_country, sort: egen times_comp_notresponsible=sum(comp_notresponsible) if diss_notresponsible==1
gen diss_compnotresponsible=1 if times_comp_notresponsible>0 & times_comp_notresponsible<10 & diss_notresponsible==1
replace diss_compnotresponsible=0 if times_comp_notresponsible==0
replace diss_compnotresponsible=0 if diss_notresponsible==0

by elect_party_country, sort: egen times_intradiss_responsible2=sum(diss_intra_responsible2)
replace times_intradiss_responsible2=. if country_id>17 & country_id<31

gen intradiss_responsible2=.
replace intradiss_responsible2=1 if times_intradiss_responsible2>0 & times_intradiss_responsible2<10
replace intradiss_responsible2=0 if times_intradiss_responsible2==0

gen diss_responsible2=0 if country_id<18
replace diss_responsible2=1 if intradiss_responsible2==1 | interdiss_responsible==1 


gen diss_comp=1 if diss_responsible==1 & diss_pol_responsible2==0
replace diss_comp=0 if diss_responsible==1 & diss_pol_responsible2==1
replace diss_comp=0 if diss_responsible2==0
replace diss_comp=0 if diss==0

by elect_party_country, sort: egen timesdiss_comp_intra=sum(comp_intraresponsible)
by elect_party_country, sort: egen timesdiss_comp_inter=sum(comp_interresponsible)
by elect_party_country, sort: egen timesdiss_comp_intrainter=sum(comp_intrainterresponsible)
replace timesdiss_comp_intrainter=timesdiss_comp_intra+timesdiss_comp_inter if timesdiss_comp_intra>0 & timesdiss_comp_intra<10 & timesdiss_comp_inter>0 & timesdiss_comp_inter<10
replace timesdiss_comp_intra=0 if timesdiss_comp_intrainter>0 & timesdiss_comp_intrainter<10
replace timesdiss_comp_inter=0 if timesdiss_comp_intrainter>0 & timesdiss_comp_intrainter<10

gen diss_comp_intra=1 if timesdiss_comp_intra>0 & timesdiss_comp_intra<10
replace diss_comp_intra=0 if timesdiss_comp_intra==0

gen diss_comp_inter=1 if timesdiss_comp_inter>0 & timesdiss_comp_inter<10
replace diss_comp_inter=0 if timesdiss_comp_inter==0

gen diss_comp_intrainter=1 if timesdiss_comp_intrainter>0 & timesdiss_comp_intrainter<10
replace diss_comp_intrainter=0 if timesdiss_comp_intrainter==0


gen intraparty_history=1 if (diss_comp_intra==1 | diss_pol_intraonly==1) & (diss_comp_inter==0 & diss_pol_interonly==0)
replace intraparty_history=0 if (diss_comp_intra==1 | diss_pol_intraonly==1) & (diss_comp_inter==1 | diss_pol_interonly==1)
replace intraparty_history=0 if (diss_comp_intra==0 & diss_pol_intraonly==0)

gen interparty_history=1 if (diss_comp_inter==1 | diss_pol_interonly==1) & (diss_comp_intra==0 & diss_pol_intraonly==0) 
replace interparty_history=0 if (diss_comp_inter==1 | diss_pol_interonly==1) & (diss_comp_intra==1 | diss_pol_intraonly==1)
replace interparty_history=0 if (diss_comp_inter==0 & diss_pol_interonly==0)

gen intrainterparty_history=1 if (diss_comp_intrainter==1 | diss_pol_intrainter==1)  
replace intrainterparty_history=0 if (diss_comp_intrainter==0 & diss_pol_intrainter==0) 

gen term_time2=time_to_nextelection2 if conflict_termination==1 & (compresponsible==1 | polresponsible==1)
by elect_party_country, sort: egen last_termination2=min(term_time2) if times_conflict_termination>0 & times_conflict_termination<10 & (diss_comp==1 | diss_pol_responsible2==1)
replace last_termination2=0 if times_conflict_termination==0 | diss_notresponsible==1
by elect_party_country, sort: egen first_termination2=max(term_time2) if times_conflict_termination>0 & times_conflict_termination<10 & (diss_comp==1 | diss_pol_responsible2==1)
replace first_termination2=0 if times_conflict_termination==0 | diss_notresponsible==1

gen pol_term_time=diss_pol_responsible2*last_termination2
gen comp_term_time=diss_comp*last_termination2
gen intrapol_term_time=diss_pol_intraonly*last_termination2
gen interpol_term_time=diss_pol_interonly*last_termination2
gen intrainterpol_term_time=diss_pol_intrainter*last_termination2


** Dataset cleanup: remove excess variables **

drop month_of_election year_of_election GDPyear_election latterhalf_yearofelection

drop intradiss_responsible intradiss intradiss_responsible2 times_comp_notresponsible times_intradiss_responsible2 diss_responsible intradisspol_responsible2 times_intradisspol_responsible2 intradisspol_responsible times_intradisspol_responsible times_intradiss times_interdiss interdiss interdiss_responsible junior_partner_intra comp_termination compresponsible notresponsible term_disc_interparty coalition_conflict2 times_junior_partner junior_partner junior_partner_intra junior_partner_inter diss_inter_responsible diss_interpol_responsible term_disc_interparty diss_intrapol_responsible2 diss_intra_responsible

drop comp_interresponsible diss_comp_intra diss_comp_inter diss_comp_intrainter diss_comp_intrainter timesdiss_comp_intra timesdiss_comp_inter timesdiss_comp_intrainter timesdiss_comp_intrainter diss_compnotresponsible diss_responsible2 diss

drop times_intradiss_responsible diss_pol_responsible times_interpol_responsible times_interpol times_interdiss_responsible interdisspol_responsible times_coalition_conflict2 comp_intraresponsible comp_intrainterresponsible comp_notresponsible times_notresponsible

drop polresponsible termination diss_intra_responsible2 diss_intra last_cab last_cab time_to_nextelection

drop term_time2 last_termination2 first_termination2 time_to_nextelection2 last_govt number_of_partners


save "[FILE PATH]\Dataset-WECEE-Dec-2021-with-party-strings.dta"​
